Go Down

Topic: Could someone please help me convert to .hex? (Read 588 times) previous topic - next topic

Things

Hi, I have a .c file and have been trying to convert it to a .hex file so that I can upload it to an Arduino using avrdude, but I keep getting a bunch of errors from the compiler.

Could someone please tell me how to convert this code into a hex file?

http://dl.dropbox.com/u/203420/ledbar.c

Thanks :)

Grumpy_Mike

#1
Jan 15, 2010, 03:23 pm Last Edit: Jan 15, 2010, 03:26 pm by Grumpy_Mike Reason: 1
This is not an arduino source code file. It contains machine specific registers so it will only run on the processor it was designed to run on what ever that is.

The line :-#define FOSC 12000000L
Suggests a 12MHz crystal, an arduino has a 16MHz one so all the baud rate timings will be off.

Do you want it to run on an arduino?

If so the best bet is to simply copy it into a window in the arduino environment and try and compile it, which it won't but then try and work through the errors. Better still write it from scratch using the arduino DMX library.

Things

Hi, this code was designed to be run on an ATMega8-P.

I was going to use the Arduino DMX library, however is contains no functions to read, and I'm not experienced enough to code it myself.

Groove

#3
Jan 15, 2010, 04:26 pm Last Edit: Jan 15, 2010, 04:34 pm by GrooveFlotilla Reason: 1
Remove the "main", move "init_port", "init_usart" to "setup" (and translate to "Serial") is the first thing to do.
See where you go from there.
Without knowing what you've done or what errors you're getting, it is difficult to help further.
Per Arduino ad Astra

Go Up