PDA

View Full Version : programs..



ukesh
06-26-2009, 07:50 PM
can the programs written for the audrino board, used for this board with the Atmega32 chip??

http://robokits.co.in/shop/index.php?main_page=product_info&cPath=6&products_id=12

debu
06-26-2009, 11:09 PM
@ukesh: Not out of the box. I have however done it. You will need to:
-Edit the \arduino-0012\hardware\cores\arduino\makefile file and change line 42 to MCU = atmega32
-Edit the \arduino-0012\hardware\cores\arduino\pins_arduino.c and \arduino-0012\hardware\cores\arduino\pins_arduino.h files to refer to pin assignments matching the Mega32.
-Edit the \arduino-0012\hardware\boards.txt file and insert the follwing mega32 definition to it. (After this you will be able to select a board called "myOwnMega32Board" from the Tools|Boards menu)


################################################## ############

atmega32.name=myOwnMega32Board
atmega32.upload.protocol=stk500
atmega32.upload.maximum_size=28336
atmega32.upload.speed=19200
atmega32.bootloader.low_fuses=0xff
atmega32.bootloader.high_fuses=0xdd
atmega32.bootloader.extended_fuses=0x00
atmega32.bootloader.path=atmega8
atmega32.bootloader.file=ATmegaBOOT.hex
atmega32.bootloader.unlock_bits=0x3F
atmega32.bootloader.lock_bits=0x0F
atmega32.build.mcu=atmega32
atmega32.build.f_cpu=16000000L
atmega32.build.core=arduino

-Lastly, prepare the bootloader. Edit \arduino-0012\hardware\bootloaders\atmega168\ATmegaBOOT_168 .c, and add the following lines in the defines section of the code. If you did step 1 correctly then this should be sufficient. Compile it using avr-gcc, and the makefile from step 1.

#elif defined __AVR_ATmega32__
#define SIG2 0x95
#define SIG3 0x02
#define PAGE_SIZE 0x40U

-Burn the hex file from the last step.

I can't take any guarantee for any of this working fine. It took me a long time to figure most of this out, and I've only ever used the resulting hardware a couple of times, that too for only simple experimental programs, so don't ask me too many questions.

Hope this helps,

Regards,

Debu :)

ukesh
06-29-2009, 09:45 PM
hey thnx a ton man!