Pages: [1]   Go Down
Author Topic: Could someone please help me convert to .hex?  (Read 550 times)
0 Members and 1 Guest are viewing this topic.
Cairns, Australia
Offline Offline
Sr. Member
****
Karma: 2
Posts: 285
Arduino??
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 637
Posts: 34579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 15, 2010, 09:26:19 am by Grumpy_Mike » Logged

Cairns, Australia
Offline Offline
Sr. Member
****
Karma: 2
Posts: 285
Arduino??
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 15, 2010, 10:34:37 am by GrooveFlotilla » Logged

Per Arduino ad Astra

Pages: [1]   Go Up
Jump to: