ok I have created a new file and inserted your code with some of my code required for access to the EEPROM but when I run this code nothing gets written to the chip.
This is the complete code:
Code:
@ __config _INTOSC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_ON & _LVP_OFF & _CP_OFF
clear
DEFINE OSC 4
TRISB = %00001000
CMCON = 7 ; Disable comparator
OPTION_REG = 0
Activate var PORTB.2 ; 1 = access eeprom / 0 = normal operation
GO VAR PORTB.3 ; Start switch
OK VAR PORTB.4 ; Green LED
NOTOK var PORTB.5 ; Red LED
Dat VAR byte[16]
i var word
j var Byte
SDA var PORTA.2
SCL VAR PORTA.3
CntrB var Byte
Addr var byte
activate = 1
for i = 0 to 15
lookup i, [$01,$01,$01,$3c,$3c,$3c,$3c,$3c,$3c,$08,$08,$08,$21,$21,$21,$FF], j
Dat[i] = j
next
for i = 0 to $7F0 step 16 'End at 2048-16 = $7F0
CntrB = %10100000
CntrB.3 = i.10
CntrB.2 = i.9
CntrB.1 = i.8
Addr = i.lowbyte
i2cwrite SDA,SCL,CntrB,Addr,[str Dat\16]
pause 10
next
activate = 0
end
I've been struggling with this almost nonstop for a couple of days and I believe that either I think I am working with a 24LC16 chip and it is not or I have a hardware issue. The EEPROM chip is not visually accessible but my PonyProg application is detecting it as"2416" - Device type "2402-16"
This is my hardware and I ruled out any discrepancies between my drawing and actual PCB:

Thanks for your time,
Mike
Bookmarks