Code:
; ########### original code on ours forum #########
;///////////////////////////////////////////
#PICAXE 28X2
'
Symbol i2cAddr24LC256 = %10100000 'For i2c address details, refer to Manual 2 "hi2csetup"
b0 = 0 'Initialise byte variables
b1 = 1
b2 = 2
b3 = 3
'
hi2cSetup i2cMaster, i2cAddr24LC256, i2cFast, i2cWord
Do
hi2cOut 0,(b0, b1, b2, b3) 'Write values to bytes 0-4 of EEPROM
Pause 50
Inc b0
Inc b1
Inc b2
Inc b3
hi2cIn 0, (b4, b5, b6, b7) 'Read values back from EEPROM
Debug
Pause 2000 'Wait 2 seconds
Loop
;///////////////////////////////////////////////////////////////////////////
; My copied and added code
#PICAXE-18m2; 20m2 ;14m2
'
Symbol i2cAddr24LC256 = %10100000 'For i2c address details, refer to Manual 2 "hi2csetup"
b0 = 0 'Initialise byte variables
b1 = 1
b2 = 2
b3 = 3
xxxxxxxxxxxx (1)
hi2cSetup i2cMaster, i2cAddr24LC256, i2cFast, i2cWord
main:
if pinc.1 = 0 and pinc.0 = 0 then goto main
if pinc.1 = 1 and pinc.0 = 0 then goto rea
if pinc.1 = 1 and pinc.0 = 1 then goto writ
Writ:
;
hi2cOut 0,(b0, b1, b2, b3,xxxxxxxx (2) 'Write values to bytes 0-4 of EEPROM
Pause 50
Inc b0
Inc b1
Inc b2
Inc b3
if bx or Wx = XXXX (3) then end high B.3,; detect reach at full memory by led
Rea:
hi2cIn 0, (b4, b5, b6, b7 xxxxxxxx) 'Read values back from EEPROM
Debug
Pause 2000 'Wait 2 seconds
goto main
;##########################
; This code can run with 20m2.18m2.14m2 or not please .
; Please give me value "b" at XXXXXXX (3 place ).Thank you so much
I would like to build the circuit for learning programming serial eeprom .But my solderless breadboard has been broken by my new dog ,in the time waiting order the new to come. Please could you help me to know this code can running with my circuit if yes please help me more to know : what value of " b" I must add set for read and write full (all) memory in 24c16 and 24c256 .
Sincerely many thank you.
lamxe
//////////////////////////////////////////////////////
# hi2cOut 0,(b0, b1, b2, b3 ??? ) 'Write values to bytes 0-4 of EEPROM *
#hi2cIn 0, (b4, b5, b6, b7???) 'Read values back from EEPROM
# if bx or Wx = XXXX (3) then end high B.3,; detect reach at full memory by led
Please help me to know values of "b" W. many thank you