Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4745

Code verify on 12F683

$
0
0
Hello all!

I haven't had any luck searching on this topic. I have a RBPro 2.50A program running on a 12F683. Program runs fine. I want to add a short section of code at the top of the program which would do a code integrity check, to try and verify that the program code got loaded correctly, and check that nothing has changed. Could be a full CRC check or maybe a quick and dirty (cheap and cheerful) summation. The PB Pro instruction to do this should be the READCODE instruction. However this instruction does not work on the 12F683.

Here's my program:

'============================
sum VAR WORD
rslt VAR WORD
i VAR WORD

sum=0
FOR i=0 to 2047
READCODE i, rslt
sum=sum+rslt
NEXT I
IF rslt != $3DF5 THEN STOP
'============================

At compile time this code produces:

Error READCODE.ASM 51:[225] undefined symbol 'eeadrh'
Error READCODE.ASM 51:[225] undefined symbol 'eedath'
Error READCODE.ASM 51:[212] extra tokens on end of line

I'm not concerned about the meaning of the error messages, just the fact that READCODE does not compile for the 12F683. The code shown here compiles fine on a 16F877.

So, my Question:
Does anyone have any ideas on how to read program memory in the 12F683 (or any other 12F part)?

Thanks in advance for any suggestions!

Viewing all articles
Browse latest Browse all 4745

Trending Articles