;================================================================
;write the data to the 24C08
;70h-7Fh contains data
;================================================================
Write_24C08 movlw b'00000100' ; Write from 0x04
movwf E2_Add_Low
clrf E2_Add_High
movlw 70h
movwf FSR
movlw .16
movwf Byte_Count ; write 16 bytes at once
call I2C_Page_Write
---
---
I2C_Page_Write call I2C_Start
rlf E2_Add_High,W
andlw b'00001110'
iorlw b'10100000' ; Slave Address - WR
call I2C_Write
movf E2_Add_Low,W
call I2C_Write
;
Page_Write_Loop movf INDF,W
call I2C_Write
incf FSR,F
decfsz Byte_Count,F
goto Page_Write_Loop
call I2C_Stop
call Delay10
return
;==============================================
;Show the written data on the display
;==============================================
Show_Setup movlw .16
movwf Byte_Count
movlw b'00000100'
movwf E2_Add_Low
;
Show_Loop call I2C_Byte_Read
movwf Number
call Display_Number ; show on LED's
call Delay255
call Delay255
call Delay255
call Delay255
incf E2_Add_Low,F ; increment E2 Pointer
decfsz Byte_Count,F
goto Show_Loop
goto Show_Setup
I2C_Byte_Read call I2C_Start
movlw b'10100000' ; Slave Address - WR
call I2C_Write
movf E2_Add_Low,W
call I2C_Write
call I2C_Restart
movlw b'10100001' ; Slave Address - Read
call I2C_Write
call I2C_Read
movf SSPBUF,W
call NACK_Slave
call I2C_Stop
return