I want to write the contents of count304 to memory location 4104 of pic18f87J90
I implemented the following code but did not work
movlw 0x00
movwf TBLPTRU
movlw 0x41
movwf TBLPTRH
movlw 0x04
movwf TBLPTRL
movf count304,0
movwf TABLAT
TBLWT*+
bsf EECON1, WPROG
bsf EECON1, WREN ;enable write
MOVLW 0x55 ;WRITE
MOVWF EECON2
MOVLW 0xAA ;WRITE
MOVWF EECON2
BSF EECON1,WR ;set WR bit to begin write
BTFSC EECON1,WR ;WAIT FOR
goto $-1 ;WRITE TO FINISH
bcf EECON1, WPROG
BCF EECON1, WREN ;DISABLE WRITES
If anyone has an idea please let me know
Thanks
I implemented the following code but did not work
movlw 0x00
movwf TBLPTRU
movlw 0x41
movwf TBLPTRH
movlw 0x04
movwf TBLPTRL
movf count304,0
movwf TABLAT
TBLWT*+
bsf EECON1, WPROG
bsf EECON1, WREN ;enable write
MOVLW 0x55 ;WRITE
MOVWF EECON2
MOVLW 0xAA ;WRITE
MOVWF EECON2
BSF EECON1,WR ;set WR bit to begin write
BTFSC EECON1,WR ;WAIT FOR
goto $-1 ;WRITE TO FINISH
bcf EECON1, WPROG
BCF EECON1, WREN ;DISABLE WRITES
If anyone has an idea please let me know
Thanks
Last edited: