Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uploading a compiled program to a C51 microcontroller

I'm trying to upload a compiled program to a microcontroller.. well my problem is not in programming or uploading things.. my problem is what to upload u.u

The program is in C and was compiled with SDCC. The mcu is an AT89S8252 by ATMEL.

I built a simple parallel port programmer following MCU protocols for serial programming as stated in its datasheet.

So far so good.. but.. what shoud I upload to the mcu??

when compiling, SDCC generates a lot of text reports.. and then an .ihx.. I suspect I should not upload this file directly but post-process it in some way to get the actual raw bytes to upload??

any help will be highly appreciated =)

like image 621
conejoroy Avatar asked Feb 28 '23 18:02

conejoroy


1 Answers

Is the .ihx file an Intel hex format file by any chance ? If it is you don't have too much more work to do before you can put your programmer to work. Intel hex format is just a specialized text format. Google Intel hex format to find what it looks like. There's a page on Wikipedia for example. Compare that to your .ihx file. If you get a match you should be able to find something to convert it to a raw binary format, ready to push down to your MCU. If you can't, you should be able to write something to do the job in an hour or so, it's very simple. I could possibly email you a tool I have written previously if you are really stuck. Good luck.

like image 196
Bill Forster Avatar answered Mar 02 '23 07:03

Bill Forster