سلام خدمت همه ی اساتید عزیز
من مشکلم با با i2c حل نمی شه.کجای برنامم مشکل داره.خروجی فقط 255 می مونه و تغییر نمی کنه بجای اینکه 30 باشه!!!!
فرستنده:
گیرنده:
من مشکلم با با i2c حل نمی شه.کجای برنامم مشکل داره.خروجی فقط 255 می مونه و تغییر نمی کنه بجای اینکه 30 باشه!!!!
فرستنده:
$regfile = "m128def.dat"
$crystal = 8000000
Config I2cdelay = 10
Config Sda = Portg.4
Config Scl = Portg.3
Dim Led As Byte
Led = 30
I2cinit
Do
I2cstart
I2csend &B01110000 , Led
I2cstop
Loop
End
$crystal = 8000000
Config I2cdelay = 10
Config Sda = Portg.4
Config Scl = Portg.3
Dim Led As Byte
Led = 30
I2cinit
Do
I2cstart
I2csend &B01110000 , Led
I2cstop
Loop
End
گیرنده:
$regfile = "M32DEF.DAT"
$crystal = 8000000
Config Sda = Portb.1
Config Scl = Portb.0
Config Portd = Output
Dim Led As Byte
I2cinit
Do
Bitwait Pinc.0 , Reset
I2cstart
I2creceive &B01110000 , Led
I2cstop
Portd = Led
Loop
End
$crystal = 8000000
Config Sda = Portb.1
Config Scl = Portb.0
Config Portd = Output
Dim Led As Byte
I2cinit
Do
Bitwait Pinc.0 , Reset
I2cstart
I2creceive &B01110000 , Led
I2cstop
Portd = Led
Loop
End
دیدگاه