I am new to Arduino, however I have used Atmel microcontrollers for projects where I work.
I have so many questions, but I will try to ask only one here…
Is the Atmel processor on an Arduino board ever programmed “directly”, with a compiled c program, without using the Arduino interrupter/os resident on the Arduino board?
The fact that I am typing this question in the “AVR Programmers” forum, makes me think that the answer to this question is “yes”…
The thing that led me to asking this is that I want to implement interrupt driven SPI slave on an Arduino board, and I can’t find that functionality in the Arduino programming reference. Actually, I can’t find any information about using interrupts in the programming reference.
That might have been more than one question… I would appreciate any info in regard to this…
Thanks for the replies… After spending some time looking at the Sparkfun site, I am starting to think that the Olimex boards are what I need rather than Arduino…
I assume I can compile a c program with avr-gcc compiler then program the avr processor on the Olimex board with an in-system programmer…
At least, that is what i am thinking at this moment in time…
Using the arudino dev platform gives a quick and inexpensive way to program avr based MCU’s, even if you’re not using the ‘arduino’ IDE to code. You can still program in assembly, or using avr-gcc, or whatever you wish. The arduino bootloader gives you a quick way of loading your program to the MCU via a serial interface. This allows you to program via serial, and use hardware/software UARTS for debugging or development, whereas if you wanted that without the arduino bootloader you’d need both your ISP programmer as well as a serial adapter. Lately I’ve simply been using the ATMega chip with arduino bootloader (along with supporting components), and Eclipse with the AVR plugin. This allows me to develop code/libraries that will work with both my ATMega chips as well as my ATTiny chips (no bootloader on those tho). So far the only real disadvantage I’ve found from this approach is that the bootloader takes up 2k of program memory.
I would however still recommend having a ISP/HV programmer to allow you to set/reset fuse bits, and would more lean towards a HV programmer just in case you mess up the fusebits and are not sure what exactly you set them to. For example, a HV programmer will allow you to set fuse bits without a crystal even if fuse bits indicate it needs one.
You’ll need to use “avrdude”. AFAIK the bootloader emulates some sort of ISP, probably the mkII. You can then configure avrdude to program the device with a USB.
you might be able to bitbang the serial port, but you can use lehmanna’s suggestion and use avrdude as well (probably easier and more reliable). I think the bootloader emulates the stk500v1 programmer, search around for programming the arduino with avrdude and you should be able to find some examples.
If you have or can get access to an AVR ISP, here’s a free AVR bootloader (512 bytes) with matching PC side program that has a graphical user interface…
krphop:
you might be able to bitbang the serial port, but you can use lehmanna’s suggestion and use avrdude as well (probably easier and more reliable). I think the bootloader emulates the stk500v1 programmer, search around for programming the arduino with avrdude and you should be able to find some examples.
I just realized that when i am running “arvdude” from the command line, it is running “/usr/bin/avrdude” which is not the arvdude that Arduino is using.
That is why it did not recognize the atmega328 processor.
So I set the verbose values in preferences.txt to true, and did an “upload to i/o board” so that I could see the exact command line that Arduino is using, which happens to be…