Hi Manish,
schematic is OLD from led message project from EPEMag, 2006/11,
the diference is only in add external EEPROM 24C08, SCL is connected to RA0 and SDA is connected to RA1.
the sch is:
intention is to put text in external eeprom and read from him,
not use internal eeprom:
old code:
;WRITE DATA TO EEPROM ROUTINE modified for PIC16F62x devices
;according to data sheet page 93 (is the same as for 16F87x device
;except that PIR2 of '87x has become PIR1 for '62x and page 2/3 not used)
;This routine is entered with W holding
;the eeprom byte address at which data
;is to be stored. The data to be stored
;is held in PROMVAL, which is located in both pages at or above $70
SETPRM: BANK1
movwf EEADR ;copy W into EEADR to set eeprom address
movf PROMVAL,W;get data value from PROMVAL and hold in W
movwf EEDATA;copy W into eeprom data byte register
bsf EECON1,WREN;enable write flag
MANUAL: movlw $55;these lines cause the action required by
movwf EECON2;by the eeprom to store the data in EEDATA
movlw $AA;at the address held by EEADR.
movwf EECON2
bsf EECON1,WR;set the ``perform write'' flag
BANK0
CHKWRT: btfss PIR1,EEIF ;wait until bit 4 of PIR1 is set
goto CHKWRT
bcf PIR1,EEIF ;clear bit 4 of PIR1
return
;READ DATA FROM EEPROM ROUTINE modified for PIC16F62x
;the data sheet page 93 is wrong! This routine here works!
;This routine is entered with W holding
;the eeprom byte address to be read.
PRMGET: BANK1
movwf EEADR ;copy W into EEADR to set eeprom address
bsf EECON1,RD ;enable read flag
movf EEDATA,W ;read eeprom data now in EEDATA into W
BANK0
return
I need change in code to write and read from external eeprom,
best regards