Hello Richard,

this is the code for all the eeprom I tested.

For the 24FC64
The best I've got it working it's at 400Khz on MSSP2 Port's
the MSSP1 does not work at all with the config I tried

'SSP1STAT = $40 'p:252
'SSP1ADD = $f 'p:258
'SSP1CON1 = $8 'p:254

I'm not well experienced but I'm trying and learning.
does the this PIC can work with an 24FC64 AT 1Mhz?

thanks for your help.



Code:
'-------------------------------------------------------------------------
' Name    : 18F25K22  EEPROM 1Mhz Test BK.pbp                                      
' only for 400Khz
' Date    : Jan 11 2025                                                
'
' not working PORTC.4, PORTC.3
' SDA / SCL  4K7 Resistor
'
'-------------------------------------------------------------------------
 Include "modedefs.bas" ' Include serial modes
;----[18F25K22 Hardware Configuration]------------------------------------------
#CONFIG
  CONFIG  FOSC = INTIO67     ; Internal oscillator block
  CONFIG  PLLCFG = On        ; Oscillator multiplied by 4
  CONFIG  PRICLKEN = ON      ; Primary clock enabled
  CONFIG  FCMEN = OFF        ; Fail-Safe Clock Monitor disabled
  CONFIG  BOREN = SBORDIS    ; Brown-out Reset enabled in hardware only (SBOREN is disabled)
  CONFIG  WDTEN = Off        ; WDT is always enabled. SWDTEN bit has no effect
  CONFIG  MCLRE = INTMCLR    ; RE3 input pin enabled; MCLR disabled
  CONFIG  LVP = Off          ; Single-Supply ICSP disabled
#ENDCONFIG


'SSP1STAT = $40     'p:252
'SSP1ADD = $f       'p:258
'SSP1CON1 = $8      'p:254


    ANSELA = 0      'All Digital
    ANSELB = 0
    ANSELC = 0


DEFINE OSC 64          '4MHz ~ 64MHz
TRISA = %00001000      ' 0:Out 1:In
TRISB = %00000000
TRISC = %00011000  
OSCCON = $70
OSCTUNE = $5F            


' EEPROM Setup -----------------------
'I VAR byte 'byte FOR 24LC16B
I VAR WORD 'Word FOR 24LC64 / 24LC256 / 24LC512
' EEPROM Setup -----------------------


H VAR BYTE        '24LC16B Only
CCT VAR BYTE      '24LC16B Only


' EEPROM Setup -----------------------
' 24LC16B
'aArray VAR BYTE[16]
'bArray VAR BYTE[16]


' 24LC64 / 24FC64
aArray VAR BYTE[32]
bArray VAR BYTE[32]


' 24LC256
'aArray VAR BYTE[64]
'bArray VAR BYTE[64]


' 24LC512
'aArray VAR BYTE[128]
'bArray VAR BYTE[128]


' Array Fill Char.
'For I = 0 To 127       ' 24LC512    65536 - 128 = 65408 Bytes
'For I = 0 To 63        ' 24LC256    32767 - 64 = 32703 Bytes
For I = 0 To 31         ' 24LC64     8192 - 32 = 8160 Bytes 
'For I = 0 To 15        ' 24LC16B    0-255


    aArray [I] = $FF    'Blank 
Next I
' EEPROM Setup -----------------------


Low PORTA.1                            ' Led end job
MAIN:                                  ' Main Routine


While PORTE.3 = 1: Wend                ' Button Press
PAUSE 100                              ' Bounce delay
While PORTE.3 = 0: Wend                ' Button release
PAUSE 100                              ' Bounce delay
Low PORTA.1


' EEPROM Setup -----------------------
'FOR H = 0 TO 7    '24LC16B
'    IF H = 0 THEN cct = $a0
'    IF H = 1 THEN cct = $a2
'    IF H = 2 THEN cct = $a4
'    IF H = 3 THEN cct = $a6
'    IF H = 4 THEN cct = $a8
'    IF H = 5 THEN cct = $aa
'    IF H = 6 THEN cct = $ac
'    IF H = 7 THEN cct = $ae




'For I = 0  To 65408 STEP 128  '24LC512 
'For I = 0  To 32704 STEP 64   '24LC256 
For I = 0  To 8160 Step 32    '24LC64  
'For I = 0  To 255 Step 16     '24LC16B 


'24LC16B OK
'I2Cwrite PORTC.2, PORTC.1,cct,I, [str aarray\16]  
'I2Cwrite PORTB.2, PORTB.1,cct,I, [str aarray\16]  


'24LC64 OK
'I2Cwrite PORTC.2, PORTC.1,%10100000,I, [str aarray\32] 
'I2Cwrite PORTB.2, PORTB.1,$A0,I, [str aarray\32]   




'-----------  24FC64  -------------------------------------


'24FC64   SAME 24LC64 
         ' MSSP1
         ' SDA1     SCL1
'I2Cwrite PORTC.4, PORTC.3,%10100000,I, [str aarray\32]  'PORT not working
         ' MSSP2
         ' SDA2     SCL2
I2Cwrite PORTB.2, PORTB.1,$A0,I, [str aarray\32]   


'-----------  24FC64  -------------------------------------




'24LC256 OK
'I2Cwrite PORTC.2, PORTC.1,$a0,I, [str aarray\64] 
'I2Cwrite PORTB.2, PORTB.1,%10100000,I, [str aarray\64] 


'24LC512  OK
'I2Cwrite PORTC.2, PORTC.1,$a0,I, [str aarray\128] 
'I2Cwrite PORTB.2, PORTB.1,%10100000,I, [str aarray\128]  


' EEPROM Setup -----------------------
PAUSE 10
Next I
' EEPROM Setup -----------------------
'NEXT H
' EEPROM Setup -----------------------
'SerOut PORTA.0,84, [" Done    : ",Dec I,13,10]
High PORTA.1
GoTo MAIN