$regfile = "xm128a1def.dat"
$crystal = 32000000
$hwstack = 512
$swstack = 512
$framesize = 512
Config Osc = Enabled , 32mhzosc = Enabled
Config Sysclock = 32mhz
Config Priority = Static , Vector = Application , Lo = Enabled
Config Com1 = 56000 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8
Open "COM1:" For Binary As #1
$eepromsize = &H8000
Config Submode = New
Config Base = 0
Config Eeprom = Mapped
Dim Twi_start As Byte
Dim D As Byte
Dim C As Byte
Dim E As Byte
Dim B As Byte
Dim A(10 , 10) As Eram Byte
$lib "fm24c64_256.lib"
Config Scl = Portc.1 ' we need to provide the SCL pin name
Config Sda = Portc.0 ' we need to provide the SDA pin name
Config Twi = 4000000
I2cinit
Do
Print#1 , "Write Eram"
For C = 0 To 1
For D = 0 To 23
E = D * 2
A(c , D) = E
Next D
Next C
Print#1 , "Eram written..."
Print#1 , "Read eram"
For C = 0 To 1
For D = 0 To 23
B = A(c , D)
Print#1 , B
Waitms 100
Next D
Next C
Print#1 , "Eram read..."
Loop
End
|