Author Topic: "ERASE 4K CODE BLOCK" fails on P89C51RD2BA  (Read 4707 times)


  • Guest
"ERASE 4K CODE BLOCK" fails on P89C51RD2BA
« 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:

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!


  • Guest
Re: "ERASE 4K CODE BLOCK" fails on P89C51RD2BA
« Reply #1 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.