d@nny
Full Member level 5

i want to write 0x3f to eeprom
is my code ok or having errors
processor 16f84
include <p16f84.inc>
__config _RC_OSC & _WDT_OFF & _PWRTE_ON
org 00h
goto main
main:
banksel TRISB
movlw 00h
movwf TRISB
banksel INTCON
bcf INTCON , GIE
banksel EECON1
bsf EECON1 , WREN
banksel EEDATA
movlw 0h
movwf EEADR
movlw 0x3f
movwf EEDATA
banksel EECON2
movlw 55h
movwf EECON2
movlw AAh
movwf EECON2
bsf EECON1 , WR
wait:
btfss EECON1 , EEIF
goto wait
banksel PORTB
movlw B'11111111'
movwf PORTB
fin:
goto fin
END
one erroe is that the symbol aah is not previously defined
---------- Post added at 18:47 ---------- Previous post was at 18:34 ----------
Error[113] C:\USERS\DANNY\DESKTOP\EEEE.ASM 24 : Symbol not previously defined (AAh)
---------- Post added at 18:59 ---------- Previous post was at 18:47 ----------
Ohhhhh
i have successfully read and write data in the eeprom after changing aah with 0aah
now i have only one problem
i can understan eeif
??????????At the completion of the write cycle, the WR bit is
cleared in hardware and the EE Write Complete
Interrupt Flag bit (EEIF) is set. The user can either
enable this interrupt or poll this bit. EEIF must be
cleared by software.?????????????
is my code ok or having errors
processor 16f84
include <p16f84.inc>
__config _RC_OSC & _WDT_OFF & _PWRTE_ON
org 00h
goto main
main:
banksel TRISB
movlw 00h
movwf TRISB
banksel INTCON
bcf INTCON , GIE
banksel EECON1
bsf EECON1 , WREN
banksel EEDATA
movlw 0h
movwf EEADR
movlw 0x3f
movwf EEDATA
banksel EECON2
movlw 55h
movwf EECON2
movlw AAh
movwf EECON2
bsf EECON1 , WR
wait:
btfss EECON1 , EEIF
goto wait
banksel PORTB
movlw B'11111111'
movwf PORTB
fin:
goto fin
END
one erroe is that the symbol aah is not previously defined
---------- Post added at 18:47 ---------- Previous post was at 18:34 ----------
Error[113] C:\USERS\DANNY\DESKTOP\EEEE.ASM 24 : Symbol not previously defined (AAh)
---------- Post added at 18:59 ---------- Previous post was at 18:47 ----------
Ohhhhh
i have successfully read and write data in the eeprom after changing aah with 0aah
now i have only one problem
i can understan eeif
??????????At the completion of the write cycle, the WR bit is
cleared in hardware and the EE Write Complete
Interrupt Flag bit (EEIF) is set. The user can either
enable this interrupt or poll this bit. EEIF must be
cleared by software.?????????????