I am programming AT89C2051 in uVision2. I am using programmer PG302. When I flash controller with hex file created using Assembler, everything is OK. But when I flash controller with hex file created using C51, I get message "Device not equal to file" (in PG302). I don't know what to do, please help if you know how. (My C51 code is OK, error is probably in created hex file, because it is about 3 times bigger than file created using Assembler (for the same function)).
I get message "Device not equal to file" (in PG302). My interpretation of this error message is that the programmer read the HEX file and wrote it to the device. It then read the device and discovered that the contents of the device was not the same as what was in the file. This does not sound like a problem with the Keil tools. It sounds like there is a problem programming the device. This may be because the program is too big for the device. Jon
"This may be because the program is too big for the device." Or, in the case of the Eval tools, because the code is located outside the address range of the on-chip flash...
I am using keil evaluation uV2. problem can't be in limitations or program size because it's very small program, 5 lines in assembler. but when I try to program controller with ANY hex (sample codes from the net, or any other surely correct code) Assembler version is working and C version is NOT working (device not equal to file - it flashes it normally, but when it verifies, i get this message). Compilation of C is also without any errors or warnings. Even when I test program with debugger, it works fine. error is probably in programmer software (pg302)
AT29C2051 2.7-Volt, 80C31 Microcontroller with 2K bytes Flash Problem solved Erik
"problem can't be in limitations or program size because it's very small program" Wrong. It's not just the size that matters - it's where you put it! Look at your map (Linker Listing) file, and see the address range where the code it located. Then look at the address range available on the chip...
"AT29C2051 2.7-Volt, 80C31 Microcontroller with 2K bytes Flash" Read the limitations page again, carefully: http://www.keil.com/demo/limits.htm It makes two specific mentions about devices with 2K bytes Flash... "Problem solved"
Ok, thanks for your help, I get it now. Demo generates memory offset at the beginning of code, and my atmel has olny 2k... Can someone tell me some other tool (freeware or demo that works on at89c2051 whitout restrictions) I can use to write progs in C51?
C51 is Keil's product - so you won't get that anywhere else! You could try the Keil MCB900 kit - it's only about 40 quid, and comes with a "restricted" version of the tools that does not have the offset. http://www.keil.com/mcb900/ For other cheap(er) and free tools, see: http://www.8052.com/links.phtml