PDA

View Full Version : READCODE Instruction dont'work



synsyn
- 8th July 2012, 20:18
Hello,

Just a question on istruction that i have never used before today.

I need to read a table of Words values stored in program space flash on my pic.
So i need to user READCODE to retrieve data from a table of DW made in Assembly
where i have stored a table of values.

But when i try to compile a very simple program that use the istruction READCODE
i will get back this errors:
---------------------------------------------------------------------------------
PICBASIC PRO(TM) Compiler 2.60C, (c) 1998, 2011 microEngineering Labs, Inc.
All Rights Reserved.
ERROR: Unable to execute mpasmwin.Error[113] C:\PBP\PBPPIC14.LIB 449 : Symbol
not previously defined (EEADRH)
Error[113] C:\PBP\PBPPIC14.LIB 463 : Symbol not previously defined (EEADRH)
Error[113] C:\PBP\PBPPIC14.LIB 477 : Symbol not previously defined (EEADRH)
Error[113] C:\PBP\PBPPIC14.LIB 491 : Symbol not previously defined (EEADRH)
Error[113] C:\PBP\PBPPIC14.LIB 899 : Symbol not previously defined (EEADRH)
Error[113] C:\PBP\PBPPIC14.LIB 449 : Symbol not previously defined (EEDATH)
Error[113] C:\PBP\PBPPIC14.LIB 463 : Symbol not previously defined (EEDATH)
Error[113] C:\PBP\PBPPIC14.LIB 477 : Symbol not previously defined (EEDATH)
Error[113] C:\PBP\PBPPIC14.LIB 491 : Symbol not previously defined (EEDATH)
Error[113] C:\PBP\PBPPIC14.LIB 823 : Symbol not previously defined (EEDATH)
---------------------------------------------------------------------------------

This is my very simple program just to test if READCODE work:


---------------------------------------------------------------------------------
TRISA = %00100000 ' Set PORTA to all input
TRISB = %00000000 ' Set PORTA to all input


DEFINE OSC 4

Char var WORD
READCODE $100,Char
---------------------------------------------------------------------------------

I use a 16f628A PIC for my project.
But if i try to compile the same prog for a 16f88/16f887(just for example) all work fine and i don't get any errors.

Have you any ideas about it :confused:
Maybe the READCODE istruction don't work on all PIC models ? :frown:


Thanks in advance,
Gabriele

Darrel Taylor
- 8th July 2012, 21:17
Not all PIC chips have the ability to read and write to their own Flash memory.

The 16F628A is one that cannot.

You can use PEEKCODE/POKECODE or LOOKUP2.
Or there's EEPROM (READ/WRITE/DATA).

synsyn
- 8th July 2012, 22:27
Thank Darrel to confirm me that READCODE don't work with 16f628A like i have supposed.
So just a curiosity; which is more faster between use poke/peek and lookup2 ?

PS:
"I Blink, therefore i am"
It too cool too true in pic's world! ROTFL :biggrin: