Hi.. Where can I learn about how microcontrollers in general work ? I would like a short article that explain what actually happens when code written on the PC begins is uploaded onto the microcontroller.
Thanks you.. that was a very good explanation. Out of curiosity, is it possible to bypass the bootloader and use the PC to store the machine-code on the arduino?
EDIT: I just read the arduino tutorial on bootloaders. That cleared up a lot of questions.
mahela007: Out of curiosity, is it possible to bypass the bootloader and use the PC to store the machine-code on the arduino?
Yes. You will need an ICSP (In Circuit Serial Programmer)device or a HVPP (High Voltage Parallel Programmer) device. You can read all about programming the internal FLASH memory and registers in the datasheet for the ATmega 168/328/328P. The software used is the same 'avrdude' that Arduino uses to talk to the bootloader.
The bootloader allows the Arduino to be programmed without additional hardware. About the only time you'd want to abandon it is if you are desperate for more FLASH space for your program.
Thanks for the info. :)
It might be helpful to find a book on "computer architecture" rather than a specific processor. A datasheet or an assembly language book will usually start off assuming that the reader already understands concepts like "registers" and "address space", which need not be true (especially since those are concepts that high level languages specifically try to hide.) An "architecture" book, on the other hand, may talk about generalities without teaching you anything at all about programming.
Some of the earlier microcomputer books will try to do both. You can take a look at Don Lancaster's "Machine Language Programming Cookbook"; it looked like a pretty good combination, but it's hard to remember what's important to say...
See his other free downloads as well: http://www.tinaja.com/ebksamp1.asp