Programovani FLASH 18F44J10
Michal HW
michalgregor@centrum.cz
Středa Červenec 4 14:17:48 CEST 2007
Pokousim se programovat pamet FLASH PIC18F44J10 a trosku jsem narazil.
V ukazkovem programu z PDFka je asi chybka:
WRITE_BUFFER
MOVLW D'64 ; number of bytes in holding register
MOVWF COUNTER
WRITE_BYTE_TO_HREGS
MOVFF POSTINC0, WREG ; get low byte of buffer data
MOVWF TABLAT ; present data to table latch
TBLWT+* ; write data, perform a short write
; to internal TBLWT holding register.
DECFSZ COUNTER ; loop until buffers are full
BRA WRITE_WORD_TO_HREGS
PROGRAM_MEMORY
BSF EECON1, WREN ; enable write to memory
BCF INTCON, GIE ; disable interrupts
MOVLW 55h
MOVWF EECON2 ; write 55h
MOVLW 0AAh
MOVWF EECON2 ; write 0AAh
BSF EECON1, WR ; start program (CPU stall)
BSF INTCON, GIE ; re-enable interrupts
BCF EECON1, WREN ; disable write to memory
DECFSZ WRITE_COUNTER ; done with one write cycle
BRA RESTART_BUFFER ; if not done replacing the erase block
Tohle mi nefunguje. Kdyz jsem si znovu precetl cely popis programovani nasel
jsem toto:
Before setting the WR bit, the Table
Pointer address needs to be within the
intended address range of the 64 bytes in
the holding register.
A prave v ukazkovem programu TBLPTR je mimo programovaci ramec. Jdu to
opravit snad mi to uz bude fungovat.
Michal Gregor
Další informace o konferenci Hw-list