2011-01-21, 21:17:47
Hello again,
Here's the solution, replace the following code
Here's the solution, replace the following code
Code:
;----------------------------------------------------------------------
; Erase & write row
;----------------------------------------------------------------------
; Erase row
program:tblwtl WADDR, [WADDR] ;??? "Set base address of erase block", equivalent to setting nvmadr/u in dsPIC30F?
mov #0x4058, W0
rcall Write
; Load latches
mov #ROWSIZEW, WCNT
latlo: tblwth.b [WBUFPTR++], [WADDR] ;upper byte
tblwtl.b [WBUFPTR++], [WADDR++] ;low byte
tblwtl.b [WBUFPTR++], [WADDR++] ;high byte
dec WCNT, WCNT
bra nz, latlo
; Write row
mov #0x4004, W0
rcall Write