bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Guys,
How can I save data to eeprom after data is valid ? with counter ?
here's the code :
thanks
How can I save data to eeprom after data is valid ? with counter ?
here's the code :
Code:
valid_byte
;SAVE SWAPPED BYTE
;eeprom address
movf save_counter,W
;movf Addr_Counter,W
movwf nTheEEAddress
;eeprom data
;movwf Swap_data
movf Swap_data,W
movwf nTheEEData
call eeWrite
;SAVE SWAPPED BYTE
;DEBUG
;bsf LED_Flag,0
;DEBUG
incf save_counter,f
;=================check if address counter is equal to 7 ( finish sending 8 bytes)
;movf Addr_Counter,W
movf save_counter,W
;xorlw 0x08 ;check if address counter is equal to 7 ( finish sending 8 bytes)
xorlw 0xFF ;TEST ONLY, check if address counter is equal to 255 ( finish sending 256 bytes)
btfss STATUS,Z
;goto read_compare
goto send_again
;BLINK LED ON-OFF-ON-OFF
goto send_and_check_finish
send_again
;address counter is here...
movlw .8
movwf byte_counter
decf State,1
return
send_and_check_finish
bsf LED_Flag,0
thanks