Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with uploading a hex to AT89C51 in Turbo6 programmer

Not open for further replies.


Full Member level 3
Sep 15, 2005
Reaction score
Trophy points
Activity points
Program error

i tri to upload my hex to at89c51 and ......
i use Turbo 6 programmer and keil C compiller

Can someone to tell me where i'm wrong please

Re: Program error

Hi syrax.

If you use evaluation version of keil c51, there is some limitation.

For example, Programs start at offset 0x0800.

And Programs generated with the evaluation software may not be programmed into single-chip devices with less than 2K Bytes of on-chip ROM.

Please check below.


Re: Program error

you can directly write the programe in keil and debug it very keil demo version the maximum limit to build a project is 2k. if your program size is small, you can try using assembly language in keil itself. you may be knowing that the hex files created from assembly will be small compared to tht in c. but assembly is a little harder than c.


Error again :((

when i offsen on 00800 it take me a error on adrress 00900
when i use another file downloaded form net it upload it


this is the file


when i download a program from chip and upload it there is no problem, when i use TASM compiler , there is no problem , but when i compile with Keil .....:(( it give me error,
Turbo can work with bin file becous when i dowload a program from IC he is in bynary format

Added after 14 minutes:

it control some LED's ot Port 3
#include <reg51.h>

int xl = 100;
unsigned int led_table[] = {

unsigned int led_table2[] = {

void Init(void);
void delay (void);

void main(void)
int aa;
P1 = 0xf0;
for(aa=0; aa<16; aa++)
P3 = led_table[aa];
for(aa=0; aa<16; aa++)
P3 = led_table2[aa];
for(aa=0; aa<20; aa++)
P3 = 0x55;
P3 = 0xaa;

void SWITCH_Init(void)
P3 = 0x00;
P1 = 0x00;
void delay(void)
unsigned int x;
for (x = 0; x<= 28000; x++);

Re: Program error


I ask you to upload the hex file because I suspect some kind of weird format or checksum errors (why always stops at adress 0x0100).
But I found none. The hex file it's OK. Your keil program is compiled starting with 0x0000 and not 0x0800 (evaluation)
I didn't check the C program only the hex file, thus I don't know if will run or not once downloaded into chip.

You said that the programmer is able to program the AT89C51 with whatever hex file downloaded from net and easy cross beyond address 0x0100 when programming AT89C51.
That was the main reason for which you suspect is something wrong with the hex file generated by keil.
Hope my assumptions are correct.

According to your hex file the size of the program is 422 bytes (address 0x0000 - 0x01A5).
The flash memory program of AT89C51 has 4096 bytes (address 0x0000 - 0x0FFF).

Well what I don't understand and I don't say that is the reason for which you're not able to program now the chip, but looking at your picture why turbo6 programmer shows a size file of 1260 bytes (0x04EC)
Same values for chip and buffer.

What means ROM: 30 and Buffer: 34 ?
The programmer is expecting 34 hex according to his buffer and received 30 hex from ROM (AT89C51) thus writing errors ?
But why, because at address 0x0100 in your hex file is data 04 hex.

However try to use the bellow binary file converted from your hex file.

If you already check program starting at offset 0x0800 and programmer stops at 0x0900 then I believe it's not a physical location damaged inside the AT89C51.

working file

i try to program from 0800 , but the error come on 0900

Added after 17 minutes:

i upload it but when wrote 00800 the buffer start at 700, and i wrote it drom 00900 and think it's ok
i mus test it and will post the result

Thanks to all

Added after 5 hours 16 minutes:

may th eproblem is in HEADer of file
can some to compile HEX file with pulsing led ot P1.0 /about 1 sec/ for 4MHz Xtall

Added after 17 minutes:

The program tell ot Chip ROM with address 100 is "00", but in the buffer the code is 45, or somethink like this

I download a program from another chip and there the program start fro 00000

Added after 33 minutes:

another working file from I-Net

Re: Program error

How can i reduce the RAM memory in C, it take me Error when my Data is up to 11.0->. I use for const "Code" memory , but when put sub routine in 2-3 level


this type incraze my data memory , how can i put validate memory to forgot trouble

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to