salam
lotfan komak ****d
moshkel in barname chie?
bayad ro lcd adade 66 ro neshoon bede vali 255 neshoon mide
hafeze janebi at24c1024 be micro motasele
lotfan komak ****d
moshkel in barname chie?
bayad ro lcd adade 66 ro neshoon bede vali 255 neshoon mide

hafeze janebi at24c1024 be micro motasele
$regfile = "m16def.dat"
$crystal = 8000000
$baud = 19200
$lib "i2c_extended.lib"
Config Serialout = Buffered
Config Sda = Portc.1
Config Scl = Portc.0
Config Portd.7 = Output
Set Portd.7
Config I2cdelay = 40
Config Lcdpin = Pin , Db4 = Pinb.4 , Db5 = Pinb.5 , Db6 = Pinb.6 , Db7 = Pinb.7 , Rs = Pinb.2 , E = Pinb.3
Config Lcd = 16 * 2
Dim Adres As Word , A1 As Byte , A2 As Byte , Hafeze As Byte
Portd.7 = 0
Adres = &H0001
A1 = High(adres)
A2 = Low(adres)
I2cstart
I2cwbyte 160
I2cwbyte A1
I2cwbyte A2
I2cwbyte 66
I2cstop
Waitms 20
Portd.7 = 1
Waitms 50
Lcd Hafeze
Do
Portd.7 = 0
Adres = &H0001
A1 = High(adres)
A2 = Low(adres)
I2cstart
I2cwbyte 160
I2cwbyte A1
I2cwbyte A2
I2cwbyte 161
I2crbyte Hafeze , Nack
I2cstop
Portd.7 = 1
Locate 2 , 1
Lcd Hafeze
Loop
End
$crystal = 8000000
$baud = 19200
$lib "i2c_extended.lib"
Config Serialout = Buffered
Config Sda = Portc.1
Config Scl = Portc.0
Config Portd.7 = Output
Set Portd.7
Config I2cdelay = 40
Config Lcdpin = Pin , Db4 = Pinb.4 , Db5 = Pinb.5 , Db6 = Pinb.6 , Db7 = Pinb.7 , Rs = Pinb.2 , E = Pinb.3
Config Lcd = 16 * 2
Dim Adres As Word , A1 As Byte , A2 As Byte , Hafeze As Byte
Portd.7 = 0
Adres = &H0001
A1 = High(adres)
A2 = Low(adres)
I2cstart
I2cwbyte 160
I2cwbyte A1
I2cwbyte A2
I2cwbyte 66
I2cstop
Waitms 20
Portd.7 = 1
Waitms 50
Lcd Hafeze
Do
Portd.7 = 0
Adres = &H0001
A1 = High(adres)
A2 = Low(adres)
I2cstart
I2cwbyte 160
I2cwbyte A1
I2cwbyte A2
I2cwbyte 161
I2crbyte Hafeze , Nack
I2cstop
Portd.7 = 1
Locate 2 , 1
Lcd Hafeze
Loop
End






دیدگاه