EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

HEX file size limit for the AT89S52 8K microcontroler

Started by lode...@ymail.com, UNEXPECTED_DATA_AFTER_ADDRESS October 13, 2009
The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).

I'm still able to load this hex file without any problems in the above 8K Micro controller. I was under the impression the 8K of the AT89S52 was the storage space, but this does not seem to be the case
.
Can anybody share some light on this for me ?

Have you run the code rather than just loaded it ?, it will prpobably run fine until you try to acces a bitof code that is above 8k, then the crash will occur.

>From the data sheet if ea pin is connected to vcc 0000H - 1FFFFH (8191 (8K)) is run from external memory, 2000H - FFFFH are to external memory, so i bet you the code above 8192Bytes is being (or trying) to be loaded into external memory even though it isn't there. (Well i'm assuming you haven't got any external memory).

I suspect the programmer allows writes above 8k but assumes you have external memory attached.

Does that sound about right ?

Regards
--- On Tue, 13/10/09, l...@ymail.com wrote:
From: l...@ymail.com
Subject: [AVR club] HEX file size limit for the AT89S52 8K microcontroler
To: a...
Date: Tuesday, 13 October, 2009, 11:55 AM


The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).

I'm still able to load this hex file without any problems in the above 8K Micro controller. I was under the impression the 8K of the AT89S52 was the storage space, but this does not seem to be the case
.
Can anybody share some light on this for me ?



The size of the hex file is not the size of the binary file. There are AT
LEAST two bytes in the hex file for each byte of storage used, plus the
address at the beginning and checksum at the end of each line. There are
other hex formats that are even larger.

From: a... [mailto:a...] On Behalf Of
l...@ymail.com
Sent: Tuesday, October 13, 2009 6:55 AM
To: a...
Subject: [AVR club] HEX file size limit for the AT89S52 8K microcontroler

The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).

I'm still able to load this hex file without any problems in the above 8K
Micro controller. I was under the impression the 8K of the AT89S52 was the
storage space, but this does not seem to be the case
.



Sorry, bit of a typo lol
Meant to say 0000H - 1FFFH (8K) is run from internal memory and 2000H - FFFFH is run from external memory.

Regards

--- In a..., STEVEN HOLDER wrote:
>
> Have you run the code rather than just loaded it ?, it will prpobably run fine until you try to acces a bitof code that is above 8k, then the crash will occur.
>
> From the data sheet if ea pin is connected to vcc 0000H - 1FFFFH (8191 (8K)) is run from external memory, 2000H - FFFFH are to external memory, so i bet you the code above 8192Bytes is being (or trying) to be loaded into external memory even though it isn't there. (Well i'm assuming you haven't got any external memory).
>
> I suspect the programmer allows writes above 8k but assumes you have external memory attached.
>
> Does that sound about right ?
>
> Regards
>
>
> --- On Tue, 13/10/09, lodewicus.maas@... wrote:
>
>
> From: lodewicus.maas@...
> Subject: [AVR club] HEX file size limit for the AT89S52 8K microcontroler
> To: a...
> Date: Tuesday, 13 October, 2009, 11:55 AM
>
>
>
>
>
>
> The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).
>
> I'm still able to load this hex file without any problems in the above 8K Micro controller. I was under the impression the 8K of the AT89S52 was the storage space, but this does not seem to be the case
> .
> Can anybody share some light on this for me ?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

It's very simple
On you harddisk it counts the bytes where every byte is a character you need 2 characters to make one byte in the controller
plus on every line in the hex file you have a adres of 4 characters and a checksum on the and of every line, and a for every line.
The hex file you can read with any editor. The binary file that is made out of this you can not read any more. a 9216 bytes hex file will result in a binary program of about 3k bytes.
Bert

--- In a..., lodewicus.maas@... wrote:
>
> The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).
>
> I'm still able to load this hex file without any problems in the above 8K Micro controller. I was under the impression the 8K of the AT89S52 was the storage space, but this does not seem to be the case
> .
> Can anybody share some light on this for me ?
>

--- In a..., lodewicus.maas@... wrote:
>
> The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).
>
> I'm still able to load this hex file without any problems in the above 8K Micro controller. I was under the impression the 8K of the AT89S52 was the storage space, but this does not seem to be the case
> .
> Can anybody share some light on this for me ?
>

http://en.wikipedia.org/wiki/Intel_HEX

--- In a..., "Donald H" wrote:
>
> --- In a..., lodewicus.maas@ wrote:
> >
> > The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).
> >
> > I'm still able to load this hex file without any problems in the above 8K Micro controller. I was under the impression the 8K of the AT89S52 was the storage space, but this does not seem to be the case
> > .
> > Can anybody share some light on this for me ?
> > http://en.wikipedia.org/wiki/Intel_HEX
>

http://www.microsym.com/content/index.php?pid=4&id%

READ and understand all documents on this site.

It sounds right yes. Somebody much more experienced then I am, contacted me yesterday via direct email, and I sent him my .asm and .hex file - which at this stage is just below 12K in size. I can still load the hex file into my AT89S52 without any errors and none of the sequences I coded is missing, which shows to me that it doesn't fail writing the complete file, without giving me errors

Something I did not knew, which was highlighted by the person helping me, is that the binary version of this 12K Hex file is about 6K, and that's why I'm still able to load it into the 8K flash.

The programmer I'm using only creates a .hex file from the .asm file, and not a .bin file as well. Maybe google is not my friend here, but even when I google the above I could not find a good hit, but the explanation does make 100% sense to me. A lot of people said I must read the manual, but not even my manual explains this .bin file concept to me

Thanx for the reply - Much Appreciated

Thank you - this explains it to me. As from a reply in this same post, the app I'm using to compile the .hex files does not produce a .bin file, therefor I never knew about the .bin file concept

Regards

--- In a..., "Phillip Vogel" wrote:
>
> The size of the hex file is not the size of the binary file. There are AT
> LEAST two bytes in the hex file for each byte of storage used, plus the
> address at the beginning and checksum at the end of each line. There are
> other hex formats that are even larger.
>
>
>
>
>
> From: a... [mailto:a...] On Behalf Of
> lodewicus.maas@...
> Sent: Tuesday, October 13, 2009 6:55 AM
> To: a...
> Subject: [AVR club] HEX file size limit for the AT89S52 8K microcontroler
>
>
>
>
>
> The hex file for my project is no exactly 8880 bytes (9216 Bytes on Disk).
>
> I'm still able to load this hex file without any problems in the above 8K
> Micro controller. I was under the impression the 8K of the AT89S52 was the
> storage space, but this does not seem to be the case
> .
>
>
>
>
>


The 2024 Embedded Online Conference