Flash Magic Forum

In-System Programming Support => P89C51Rx+/P89C51Rx2/P89C66x/P89C6xX2/P89V66x => Topic started by: markus_13 on April 04, 2005, 04:37:11 AM

Title: "ERASE 4K CODE BLOCK" fails on P89C51RD2BA
Post by: markus_13 on April 04, 2005, 04:37:11 AM
Hi to everybody,

I use a P89C51RD2BA , a 20.000MHz crystal and a
code thankfully inspired by the Keil Example, can be found here:
http://www.esacademy.com/faq/progs/flash.htm

I have a problem with the IAP Routine "ERASE 4K....".

The device seems to hang up somehow while it's doing the
ERASE of a given Block.

After Restart I see that the block is erased correctly, which is on the good side. The bad thing is, the following block is erased as well!!?
I'm not absolutely sure, but i think all following blocks are erased, accept block F!?

One idea is that the code in the example is written for the first generation (the ....H type)? Of course I've adjusted the block adresses and sizes.


Another idea was to ensure that Vcc, which is equal to Vpp on the board, is 5.0 V. That doesn't changed anything.

Can anybody give help please?

Thanx a lot!
markus
Title: Re: "ERASE 4K CODE BLOCK" fails on P89C51RD2BA
Post by: markus_13 on April 04, 2005, 06:47:14 AM
ok....found the problem by myself:

I changed the Code Optimization Level for the Keil C-Compiler.
using "Reuse common entry code " instead of "Register Variables" fixed the problem.
m.