Im having a bit of trouble getting this code working.
Heres some test code i wrote
This code should set W to 38 then move that value to FSR0.Code:MOVLW 38 MOVWF FSR0 MOVLW 57 MOVWF 38 MOVFF INDF0,TXREG
It then sets W to 57 (my test value) and moves W to memory location 38. Then it sends INDF0 over serial to the PC. I would expect INDF0 to reference memory location 38 and send 57 but it doesnt. I keep getting random values (a different one each time i reset the PIC asif its an uninitialized memory location). Its not a serial problem. MOVWF TXREG sends the correct value.
I know im writing data to memory location 38 and if i read FSR0 back it also says 38. Did i miss something obvious? It seems like both are accessing memory location 38 but in 2 different blocks of memory (im not sure if thats possible)




Bookmarks