Microcontroller › 8051 › how to convert C code into hex code using keil compiler › hello sri.venkatraman, the
hello sri.venkatraman,
the at89c51 has 4Kbytes of flash….
can you send the link for the project which one (project on this site) you are talking about…
for your solution us can use s52 or c52 which as 8kb of flash… i think even they might have used the same…
one more interseting thing which might solve your doubt…
where you saw the size of your hex file?… just right click on the file and going to the properties in that way you might have checked am i right?… sir you are 100% wrong if you have assumed that is the original amount of hex which is going to be dumped in your controller…
open your hex file…
//……………………………………………………………
let me take one line from this hex file
:100000000C942A000C9434000C9434000C943400AA
:CCAAAATTXXXXX……XXSS
1)new line in hex file always starts from “:” (colan)
2)the first two digit shows the number of bytes in that line (all the values written in hex)…”CC”
3)the AAAA the next four digits shows from where this line should start… the starting address…
4)type of the line.. if TT=00 more lines are there in that hex file,,, if TT=01 that is the last line in that hex file…
5) XXXX……..XX is the original code that is going to be dumped into you controller..
6) at last the SS is the checksum for the complete line.
if you want the original size of your hex code you going to dump go to the second last line note the address and add the count bytes (CC) thsi will tell the original size…
the size see in the properties of file is the size of that text file which includes all the :, CC, AAAA and SS which you are not goin to dump in your controller