Maker Pro
Maker Pro

Converting C code into a Hex code

T

tico_tech

Jan 1, 1970
0
Hi:
I'm learning to program embedded systems with C, and I'm trying to find a
program that would convert C code into Hex code so I can program my
microcontroller which is an AT89C2051.
I already have a program to convert Assembly code into Hex, because that is
th language I use to program. This is the first time I use C to write a
program for a microcontroller, so I would like some assistance in this
issue.

Thanks.
 
T

tico_tech

Jan 1, 1970
0
Yes, I have used keil compiler before, but when I compile my C program
,convert it to hex and try to burn it on my AT89C2051 using a programmer
from iguana labs, I receive an error that says, "Data Address, 810h, in hex
file is outside valid memory range, 0000h-0800h, for selected
chip.Programming aborted"
Any suggestions on this issue?
 
D

Dan Henry

Jan 1, 1970
0
Yes, I have used keil compiler before, but when I compile my C program
,convert it to hex and try to burn it on my AT89C2051 using a programmer
from iguana labs, I receive an error that says, "Data Address, 810h, in hex
file is outside valid memory range, 0000h-0800h, for selected
chip.Programming aborted"
Any suggestions on this issue?

Umm, make your program shorter.
 
T

tico_tech

Jan 1, 1970
0
The program is only ten lines long. It simple makes an LED blink.
 
D

Dan Henry

Jan 1, 1970
0
[Top-posting corrected]
The program is only ten lines long. It simple makes an LED blink.

Are you using an evaluation version? If so, have you checked its
limitations?

Have you examined the map file output?

--
Dan Henry

A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
 
A

Andrew

Jan 1, 1970
0
Dan said:
[Top-posting corrected]
The program is only ten lines long. It simple makes an LED blink.
Are you using an evaluation version? If so, have you checked its limitations?
Have you examined the map file output?

The evaluation version is limited in that it can only compile programs with
<2K output and also in that it starts the compiled code at location 0x800
(i.e. just after the first 2K of memory space). This is to prevent the demo
compiler being used as what would effectively be a full version for
microcontrollers (such as the AT89C2051) that only have 2K of program
memory. You will either need to use a microcontroller with >2K flash, of
which the first 2K will be wasted (e.g AT89C4051?) or buy the full version
of the compiler.
http://www.keil.com/demo/limits.htm
 
T

tico_tech

Jan 1, 1970
0
Thanks for your answer, it helped a lot. Now, this makes me ask another
question, where can I find a C compiler that would convert my programs into
hex code so I can burn them on my 89C2051 for free.
I'm learning to program embedded systems in C, but I don't want to spend the
extra money on these expensive compilers. I know you are going to suggest
buying some other chip, but I don't want to do that.
Any suggestions on this issue?

Thanks.
Andrew said:
Dan said:
On Sat, 24 Apr 2004 21:46:49 -0400, "tico_tech"

Yes, I have used keil compiler before, but when I compile my C
program ,convert it to hex and try to burn it on my AT89C2051
using a programmer from iguana labs, I receive an error that says,
"Data Address, 810h, in hex file is outside valid memory range,
0000h-0800h, for selected chip.Programming aborted"
Any suggestions on this issue?

Umm, make your program shorter.

[Top-posting corrected]
The program is only ten lines long. It simple makes an LED blink.
Are you using an evaluation version? If so, have you checked its limitations?
Have you examined the map file output?

The evaluation version is limited in that it can only compile programs with
<2K output and also in that it starts the compiled code at location 0x800
(i.e. just after the first 2K of memory space). This is to prevent the demo
compiler being used as what would effectively be a full version for
microcontrollers (such as the AT89C2051) that only have 2K of program
memory. You will either need to use a microcontroller with >2K flash, of
which the first 2K will be wasted (e.g AT89C4051?) or buy the full version
of the compiler.
http://www.keil.com/demo/limits.htm
 
D

Dan Henry

Jan 1, 1970
0
[Top-posting corrected]
Thanks for your answer, it helped a lot. Now, this makes me ask another
question, where can I find a C compiler that would convert my programs into
hex code so I can burn them on my 89C2051 for free.
I'm learning to program embedded systems in C, but I don't want to spend the
extra money on these expensive compilers. I know you are going to suggest
buying some other chip, but I don't want to do that.
Any suggestions on this issue?

Thanks.

You could try SDCC. http://sdcc.sourceforge.net/

--
Dan Henry

A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
 
Top