Dear All
I need to read flash from a pic18F2620, itried to write some function for access it but i had a failure
the code is this:
void init_pointer_flash(char code_addr_upper, char code_addr_high, char code_addr_low)
{
asm movlw _code_addr_upper;
asm movwf _tblptru;
asm movlw _code_addr_high;
asm movwf _tblptrh;
asm movlw _code_addr_low;
asm movwf _tblptrl;
}
this set pointer start address and is compiled without error
char read_flash(void)
{ unsigned char a;
asm tblrd*+;
asm movf _tablat,0;
asm movwf _a;
return a;
}
this read code from address, increment p