PDA

View Full Version : Limit of PokeCode??



financecatalyst
- 15th June 2012, 13:45
I have to load 500bytes of data to my 877a. I have started at location 7100. I put this statement first towards the start of the code:


ERASECODE 7100

I then used the POKECODE @7100 .............

The problem is that after 255 locations I am getting problem with the compiler. How can I load 500 bytes of data without any interruption in between?

Darrel Taylor
- 15th June 2012, 17:25
POKECODE puts the data in the .hex file, and the programmer puts it in the chip while programming.
It does not write to flash memory at run-time.

So putting ERASECODE in your program would normally erase what was already programmed.

But on the 16F877A, you cannot use ERASECODE because there is no FREE bit in EECON1.
When writing to flash at run-time on this chip, it does an erase/write cycle much like EEPROM.
There is no mechanism to erase blocks of FLASH memory.
Most PIC chips do not work that way.

So just lose the ERASECODE statement.
And don't try to put all 500 values in the same POKECODE statement.
Split them up into multiple POKECODEs.

financecatalyst
- 15th June 2012, 20:18
Thanks Darrel. I didn't knew about the EECON1 (Still don't, never came across dealing with it). I read a post by Melanie about PokeCode sometime ago, I tried searching it now but could not find it. There I remember reading about this ERASECODE, I guess I missed some part of it where this must have been explained.

For now I have removed any ERASECODE statement, and divided the Pokecode into 2 statements (each with 250 values), and it compiles fine for now. Currently everything I am doing, I am simulating it on proteus, I hope when I burn this to PIC finally, all works fine.

Thanks for your help.