Crossing the Divide From Software Dev To Hardware Dev 105
First time accepted submitter szczys writes "Quinn Dunki spent decades developing software before she fabricated her own 6502-based computer. Here she talks about crossing between software and hardware (or the other way around) and why this is easier today than it has been in the past."
Re: (Score:2)
What type of transistor?
Re: (Score:2, Funny)
> What type of transistor?
P=NP
Re: (Score:2)
Touché. Hardware and software have more in common than I thought.
Re: (Score:2)
Bravo!
Re: (Score:3)
Why don't you know those things? At least in overview?
Some people are actually curious about technology of all sorts and have an interest in understanding it. As a software developer, I find having a decent knowledge of the hardware to be quite helpful.
Re: (Score:2)
knowing most of those things should be a requirement for voting...
dunno why the fuck buy a PI though.
just buy some usb sensors and actuators if that's the thing you want.
That article was fucking awful. (Score:2, Insightful)
tl;dr "Software is a bit like hardware but hardware is less virtual."
Am I missing some point here? Maybe this person has achieved something I don't know about that makes their message more relevant than I can see.
Re: (Score:1)
It's tough to be negative about someone who appreciates the 6502, but there is a huge difference between putzing around with discrete components and DIPs vs true hardware engineering these days.
Stuff that was hard awhile ago is definitely easier now, but technology has moved on...professional hardware designers are doing much more complex stuff.
Re:That article was fucking awful. (Score:5, Interesting)
Yeah, nowt wrong with playing with a 6502 - I grew up on them - but building a 6502-powered toy requires only a few tens of dollars, moderate skill with a soldering iron, and the ability to vaguely follow any of several dozen short articles on putting together a simple 8-bit machine.
Of course it's cool to build your own hobby quality 6502-based machine. And there are probably lots of EEs who would fail at such a project without assistance - not because it's wildly complex but because it's sufficiently esoteric. But that doesn't mean you're qualified to pontificate on the transition from pro s/w to pro h/w development just because you've built such a machine. The tools, goals, risks, breadth, imagination, etc. put into a hobby product are quite different from that put into a pro product.
To take another example, with my ham radio hat on I get involved in lots of cool projects which would never make for a saleable product, but which I'd never get the chance to do professionally anyway, because relevant demand is satisfied for the average consumer in a very different way (e.g. almost everyone is happy with relying on a huge amount of private and political infrastructure to communicate globally).
Re: (Score:3)
The biggest barrier to doing cool stuff NOW with homebrew hardware is DRM. Or, more precisely, the fact that any SoC infected by HDMI or the ability to do hardware-accelerated h.264 is going to be encumbered by viral licensing terms that make it nearly impossible for anyone smaller than Logitech to get their hands on real sourcecode and unredacted datasheets for the best chips out there... or even the ones that are 17 steps down from the top, and so ghetto, not even $7 media players from China embedded in H
Give it up already (Score:1)
Is the lack of documentation hampering your development? You wouldn't have much of this high end technology if had companies not sunk development money into it and licensing to recoup their costs.
Re: (Score:1)
Oh quit whining! If you expect me to give a shit about those poor little companies who are only trying to recoup their cost by bilking their uses and hiding their specs? Fuck you, asshole.
Re: (Score:2)
Progress happens despite the excesses of capitalism, not because of them.
Companies would also be more profitable with slaves, but they don't stop producing when slavery is outlawed. It's up to the society that protects these profiteers' property to regulate them as it judges best.
Re: (Score:2)
Re: (Score:2)
Yes, yes and yes.
There plenty of things to hack in hardware, but if you want to play with digital circuits cheaply, an FPGA is your friend.
Re: (Score:2)
> 30-40MHz is the point where stuff that's not properly designed just plain doesn't work)
So design it properly. FFS.
Re: (Score:3)
OK, more precisely... 30-40MHz also happens to be the point where the demands imposed by a "proper" design ALSO outstrip what you, as an individual, can build with a home-etched 2-layer circuit board, hand solder, and/or troubleshoot when it doesn't work reliably. It's the point where things like 4-layer circuit boards with ground planes and solder masks become non-negotiable requirements. And it's the line in the sand where getting multiple devices to coexist and share that same high-speed bus becomes a RE
Re: (Score:2)
Yes. A board with a ground plane is handy for higher frequency signalling. If you have sufficient cash, you can use one the of hobbyist PCB suppliers to build the PCB for you on a 4 or 6 layer process.
An alternative for the home hobbyist is to use impedance controlled wires, like twisted pairs or mini coax, terminated correctly. This is more fiddly, but still doable.
Re: (Score:2)
Stuff that was hard awhile ago is definitely easier now
Sometimes. 6502 systems come up taking memory for granted. On a modern x86 or ARM, there isn't any system memory when the CPU comes out of reset. It has to initialize the memory controller and the DRAMs themselves before it can use system memory. It's much easier to write the firmware for a 6502 based system.
Re: (Score:1)
Re: (Score:2)
Alas, no. In the x86 world, the initial code runs without any memory just long enough to set up 'cache as RAM mode' where the cache itself acts as RAM even though there's nowhere to write back/through to. That can be a bit fragile since cache line eviction can still occur and there's nowhere to evict it to. It the late '90s the controllers were a bit simpler and the memory could be set up using only ROM and registers.
To top it off, it's all mostly undocumented and a few chipset manuals are works of pure fic
Re: (Score:2)
Remember, this is cache as RAM. The cache IS the memory the firmware is depending on to function. If it gets evicted, you crash. Imagine a program in C. Now, suddenly zero the stack while it's in a function call and see how it performs.
Meanwhile, the DIMMs are programmed by accessing specific relative locations in memory with the controller set to a special mode. That won't work if other writes get in the way.
Re: (Score:1)
Yay for that, but otherwise it seems to be celebrating mediocrity. . .
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
well do you want to see pics of men who have done sw for 3 decades?
I guess the real problem with the feat is this http://www.6502.org/homebuilt/ [6502.org]
Re:That article was fucking awful. (Score:4, Informative)
Re: (Score:2)
When you develop hardware, you use software simulators, FPGA boards with bit files (a binary representation of the hardware circuits that can be stored on flash memory) and actual silicon. The software simulator is meant to simulate the memory mapping and parallel nature of the hardware, the FPGA boards do this a bit quicker, and actual silicon is the real deal. Only the first two can be updated if things don't work as planned unless the hardware has programmable microcode.
Re: (Score:1)
Everything is easier today! (Score:2)
Geez, when I started programming all you had with stdclib. Now I have teams of people who know orders of magnitude more than I do doing my bidding. It's great!
Seriously, though, everything is easier these days. There's a ridiculous amount of stuff out there, if you have enough time to plow through it all.
Re:Everything is easier today! (Score:5, Informative)
If the point is that you can still do old school low frequency projects from the ground up
It is, however, easier to fool yourself into thinking it is easy, but if someone who actually knows what they are doing looks at your code they will have trouble deciding if they should laugh or cry.
Re:Everything is easier today! (Score:5, Informative)
To expand - and put this more in the context of a mobile phone class device say.
Why open-source software works is:
Widely available repository of code.
Many people able to review it, or sections of it, and understand it.
Ease of submitting tested patches.
Hardware has problems that don't really fit well with this.
The open schematic is the trivially easy part, and not really a problem.
(though in practice, you need a schematic with copious links to design documents, which isn't well solved by open tools).
The number of people who can review it is rather smaller - as you can't
open up a c file, and see a clear error or awkwardness in code that can be edited.
For all but the most basic errors, you are going to have to sit down and
read several hundred pages of hardware documentation about how the chips in question work, in addition to having in-depth knowledge about the circuit design, and costings of likely changes.
Now, you've done this, and generated a patch that you think (for example) lowers the supply current by 1%.
Compile - test.
On a PC, this takes a couple of minutes.
For something of a smartphone class, a one-off PCB may cost several hundred dollars. Then the parts will cost another several hundred dollars in small quantities, as well as being difficult to obtain.
Now, you have to solder the parts onto the board, which is a decidedly nontrivial thing - and if you decide you want someone else to do this, it's probably another several hundred dollars.
So, you're at the thick end of a thousand dollars for a 'compile'.
Now, you boot the device, and it exhibits random hangs.
Neglecting the fact that you are going to need several hundred to several thousand dollars of test equipment, you now have to find
the bug.
Is it:
A) The fact that unlabled 0.5*1mm component C38 is in fact 20% over the designed value, as the assembly company put the wrong one in.
B) C38 has a tiny bridge of solder underneath it that is making intermittent contact.
C) The chipmaker for the main chip hasn't noticed that their chip doesn't quite do what they say it will do, and the datasheet is wrong.
D) You missed a tangential reference on page 384 of the datasheet to proper setup of the RAM chip, and it is pure coincidence that all models up till now have booted.
E) Because you're ordering small quantities, you had to resort to getting the chips from a distributor who diddn't watch their supply chain really carefully, and your main chip has in fact been desoldered from a broken cellphone.
F) Though the design of the circuit is correct, and the board you made matches that design, and all the parts are correct and work properly, the inherent undesired elements introduced by real life physics means it doesn't work.
G) A completely random failure of a part that could occur with even the best design, and best manufacture.
G - may mean that it's worthwhile making two or more of each revision - which of course boosts costs.
Hardware is nasty.
This gets a lot less painful of course for lower end hardware. For very limited circuits, which can be done on simple inexpensive PCBs, and be easily soldered at home - costs of a 'compile' can be in the tens of dollars, or even lower.
Re: (Score:2)
Re: (Score:1)
But if the claim is that it is easy to do the hardware and software for a complete system on a par with contemporary designs? No friggin' way. Period.
No one made that claim, Don Quixote. Settle down. It's a lot easier to do what you did in the 80's and 90's now though, simply because there's a lot more easy to find information.
Re: (Score:2)
I think you missed the point. They're not saying doing things at the bleeding edge today is easier than the bleeding edge yesterday, they're saying doing the things bleeding edge yesterday are easier today.
Re: (Score:2)
Bollocks.
The transmission line tools are all there. I've done board up ARM designs in a basement, from the IC through to bootloading.
It wasn't wire wrap cheap, but it wasn't undoable, either. There are solid reference designs you work from. My budget was about $35,000 in 2005.
What's different today is documentation is very good, everywhere, there are lots of reference designs, and places to get help. If the platform you're working on doesn't have those, you go somewhere else.
The Pi has a full set of open de
Re: (Score:2)
I did mine for less than $300.00. See the difference?
I told you ... I designed one myself from the ground up. Now if your point is that it is much easier to design hardware if you just buy it pre-designed and pre-made, then I totally agree with you. Buying it pre-designed and manufactured is indeed easier than designing it yourself.
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
Re: (Score:1)
Re: (Score:2)
There's a ridiculous amount of stuff out there, if you have enough time to plow through it all.
That is what makes it hard these days. And once a while you still have to write programs using the standard C libraries (stdclib is C++, you lucky bastard ;-p)
Run! (Score:4, Insightful)
Run the opposite direction!
Software is made up of worlds created by people hopped up on caffeine and suffering from too little sleep. Hardware follows physical laws, software follows no laws.
Hardware is created, finalized and shipped. Software is a never ending dreary of bug fixes, upgrades and incompatibility.
For your own sanity, stay away.
Re: (Score:2)
... software follows no laws.
Tell that to my compiler. I'd say if anything software is very structured; you have a limited pool of recognized syntax that can be combined in specific ways. If you're using a library, you have to adhere to its API. Ultimately your code will be running on some processor, which has a limited set of instructions it can perform. Software has no laws? Hardly.
For your own sanity, stay away.
Sounds like it might already be too late for you...
Re: (Score:2)
Engineering isn't about proof, that's math. Engineering is about tolerances.
No engineering is about responsibility.
If you call yourself a engineer be prepared when somebody asks:
Who is responsible for this crap?
Re: (Score:2)
FWIW, many states' engineering licensing boards are starting to offer a software engineering licensing exam.
Re: (Score:2)
State PE (principle and practice of engineering) exams have had software options since I took them back 23 years ago. The main thing new is that it used to be an small optional element of the Electrical Engineering discipline, eventually became a larger optional element of the Electrical/Computer Engineering discipline, and now (just starting last year) Software Engineering test is available as it's own discipline.
The just released pass rate for the new PE-SW test is pretty dismal (~50%) compared to the PE
Re: (Score:2)
I think you mixed up mathematicians and engineers.
engineering isn't about absolute proofs, it's just abut having expertise to know that a certain solution is good enough and doable for the job at hand. be it a house, navigation clock, ditch or a football that needs to be created.
Re: (Score:3)
Hardware is created, finalized and shipped.
If only that were true. Almost all older devices have some kind of bodge in them. A wire soldered on here, an extra resistor there. Sometimes you can't even see where they realized a component value was wrong and re-fitted all their existing stock. The only reason it's less common now is that more things have firmware and can be bodged via a software upgrade.
Not that simple (Score:2)
Designing something that runs close to the DC end of the spectrum like a 6502 requires far less engineering know how than pushing into the high speed domain beyond 100MHz. That doesn't invalidate the value of designing with "old" tech when if will suffice but it isn't a viable way to change career paths.
Re: (Score:2)
There is no divide (Score:1)
If you don't know both, you are only using half your brain
Convergence is happening (Score:1)
Re: (Score:2)
The real difference is that it costs hundreds of $k to compile the final package in silicon. ;-)
Only hundreds of thousands? From what I remember, our masks alone used to cost $1,000,000+, and a 'cheap' metal layer fix for a chip bug was about $50,000.
Hardware is essential (Score:3)
Re: (Score:3)
I strongly disagree with that notion. It's important for developers to understand how the hardware is architected in some cases, but that's not the same as having an understanding of hardware design. The developers don't need to know about coupling or latch-up or impedance matching. If they do, that's a sign that the hardware engineers did something very, very wrong.
Re: (Score:3)
I have a friend taking a Software Engineering degree right now and w
Re: (Score:2)
I have a friend taking a Software Engineering degree right now and when I look at his code I shutter. Well his code is pretty and utilizes managed run-times and style, it's generally a resource disaster and he's admitted to me they don't even have a course on resource management. He can't tell me how many bytes of memory his program will use, how to optimize the pipeline for better run-time, how to save I/O loading through DMA requests and etc...
But how would he even know that stuff? The issues you are describing are very platform-specific and deep down to hardware. They should be mostly the problem of the compiler and operating system.
I agree though that you have to know what happens under the hood to be a good programmer. That could mean, for example: knowing a bit about executable formats, how a CPU works (registers, program counter, flags...), what kind of init code does the compiler insert, how are stack and heap organized, and how to use a de
Re: (Score:2)
Re: (Score:2)
All of these and more need to be actively in your head well you code.
These are all distractions for the things that matter.
He can't tell me how many bytes of memory his program will use
Cross compile to 64 bits and the answer will be different. Use a different C++ compiler and the answer might be different. Compile for a different OS and the answer might be different (some structs have different sizes on different platforms).
how to optimize the pipeline for better run-time
This should be done by the compiler. Besides, are you assuming an x86 CPU? You *do* know software these days are expected to be portable across CPUs, right?
how to save I/O loading through DMA requests
WTF? Are you still programming in DOS? How do you enforce D
Re: (Score:2)
Re: (Score:2)
You should never just fall back and let the OS run your code without thinking how it's going to run your code and how your code will interact with your hardware
Look, when I write Javascript, the most I would do is to look at how the 4 major browsers execute the code. I don't think about what the OS would do. Heck, given the ever evolving state of Javascript engines these days, I don't even know what the browser actually does. Does that make 99.99% web developers out there bad programmers?
When I write Java, it could end up running on Windows, Linux, MacOS, or Android, even on other platforms. The heavily optimized JVM handles the hardware/OS level optimizations for
Re: (Score:2)
Re: (Score:2)
Exactly my point. The people designing a language, the OS and the compiler should know something about the hardware, but the programmer only needs to know what the API guarantees.
Even more than one thinks (Score:3)
I am a fan of the people who build their own computers from MSI components [iinet.net.au].
I discovered microprocessors around 1980, when I was 14 years old, but here in little Belgium I was never able to do something with that knowledge at that time, but my interest got me a bachelors degree in electronics, and a good (better) understanding on how software works. I was always interested in FPGA, but it is only since 2010-2012 that I got finally a possibility to do more than programming. I got my master degree in electronics, and on the way I learned VHDL (one of the reasons that I wanted to go for my master degree), and got an interesting school assignment about on the fly reconfigurable hardware and a thesis involving the Spartan-6 Atlys board.
Also, since 2004 I have been working on and off studying Common Lisp, and processor emulators.
Well, since September 2012 I have been designing a simple microprocessor, for which I first did the implementation of an assembler in Common Lisp, and a simulator, and start of this September I finally got around implementing the simple computer system in VHDL. I was surprised how easy it was, given that I only have about 1 to 2 hours a day in the evening to work on things. It is currently a 16-bit thing which uses 64kB of FPGA block RAM.
Thus, with software knowledge and VHDL, it should become even easier to build custom microprocessors.
And I am not even crossing this line. It has always interested me to go for both hard- and software, but due to circumstances I ended up more on the side of software.
Having the room for doing electronics properly is not that easy. One needs a place committed to it, which can not be used by other people in the family. For that reason, I like the concept of FPGA development boards. It lets me do what I want to, without needing to invest in dedicated space.
The Atlys board gives me all I need for growing in the future. The first part should be to make the system run using the on-board serial controller, so that I can control it through a terminal program, having access to a keyboard and a character terminal.
And I am not done with software, because one of my goals is to write a Lisp system for running on the system, and then start to optimize the ISA for better performance. Other things: go to a 32-bit implementation and start using the on-board 128 MB RAM memory.
A modern drawback (Score:1)
I love hardware. Built a 6800 machine on solderless breadboards quite a few years back. Kind of a dumb thing to do durability wise, but it was quick and easy. That brings me to my point. Many new devices these days are only available as surface mount devices. Have you ever tried to solder one of those bad boys into a circuit? The Arduino and its ilk are great but shields and stuff are basically pre-built and component level design is becoming a lost art. Well, I suppose you could say that the advent of ICs
Re: (Score:1)
Re. Schmartboard adapters, here's a 0.5 mm pitch QFP to 0.1" adapter [schmartboard.com]. It's 10 bucks. OK, a BGA one is $45. But still, what are you looking at that you don't find inexpensive enough? What family of devices are you wanting to work with?
Aside from hacking some existing proto- or dev-board with the device you want to work with (e.g. with short patch cables or headers to a breadboard or other daughter proto-boards), you should consider just biting the bullet and learning to design and solder your own SMT PCB
Hardware is just petrified software. (Score:2)
I fail to see the difficulty, or the divide, since hardware is a question of petrifying some software to enhance the operation of certain algorithms.
I remember reading articles several years ago by Chuck Moore about what he was doing to control a silicon foundry to produce chips which would hard wire some algorithms in silicon while leaving the rest as software implementations in Forth.
TILs (Threaded Interpreted Languages) lend themselves very well to this.
The level of interpretation, and the repetition of
Re: (Score:3)
Not quite - hardware is only good at petrifying O(1) algorithms. They have to be tightly bounded in space and time.
Go the FPGA way. (Score:3)
I've taken the high tech way to designing hardware - FPGAs. So far I've built quite a few bits and bobs - 200MHz GPS referenced frequency counters, a 60 stage Mandelbrot pipeline (12B Ops per second @ 200MHz), SDRAM controllers, my own processors, video adapters, and implemented the DVI-D protocol. I've even worked out how to make a chip with 1Gb/s outputs work at 1.5Gb/s - yay! 1080p! Everything is in a HDL (Hardware Description Language) so can be used by others on their own projects. It isn't that expensive - dev boards start less than $100.
As Quinn points out it takes a very long time to get everything working correctly - you software guys don't know how lucky you have it!
I've put some of my projects on my wiki at http://hamsterworks.co.nz/mediawiki/index.php/FPGA_Projects [hamsterworks.co.nz] if anybody wants to take a look.