سلام دوستان
چرا در مد spi داده ها درست انتقال داده نمیشه؟؟؟؟
من از بسکام استفاده می کنم مشکل این برنامه چیه؟؟؟؟
داده ها یکی در میون ارسال میشه هر کاری هم کردم درست نشده!!!!!!!!!!!
master program
چرا در مد spi داده ها درست انتقال داده نمیشه؟؟؟؟
من از بسکام استفاده می کنم مشکل این برنامه چیه؟؟؟؟
داده ها یکی در میون ارسال میشه هر کاری هم کردم درست نشده!!!!!!!!!!!
master program
$regfile = "m32def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Pina.4 , Db5 = Pina.5 , Db6 = Pina.6 , Db7 = Pina.7 _
, E = Pina.3 , Rs = Pina.2
Config Lcd = 16 * 4
Config Spi = Hard , Interrupt = On , Data Order = Lsb , Master = Yes , _
Polarity = High , Phase = 1 , Clockrate = 4
Enable Spi
Dim A As Byte
Spiinit
For A = 0 To 10
Spiout A , 1
Wait 1
Spiinit
Wait 1
Next A
End 'end program
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Pina.4 , Db5 = Pina.5 , Db6 = Pina.6 , Db7 = Pina.7 _
, E = Pina.3 , Rs = Pina.2
Config Lcd = 16 * 4
Config Spi = Hard , Interrupt = On , Data Order = Lsb , Master = Yes , _
Polarity = High , Phase = 1 , Clockrate = 4
Enable Spi
Dim A As Byte
Spiinit
For A = 0 To 10
Spiout A , 1
Wait 1
Spiinit
Wait 1
Next A
End 'end program
slave program
$regfile = "m16def.dat"
$crystal = 8000000
Config Spi = Hard , Interrupt = On , Data Order = Lsb , Master = No , _
Polarity = High , Phase = 0 , Clockrate = 4
Config Lcdpin = Pin , Db4 = Pina.4 , Db5 = Pina.5 , Db6 = Pina.6 , Db7 = Pina.7 _
, E = Pina.3 , Rs = Pina.2
Config Lcd = 16 * 4
Enable Interrupts
Enable Spi
On Spi Yes
Dim A As Byte
Spiinit
Cls
Home Upper
Lcd " NO SPI"
Home Lower
Do
Wait 1
Loop
End 'end program
'--------------
Yes:
Disable Interrupts
Spiin A , 1
Lcd A
Enable Interrupts
Return
$regfile = "m16def.dat"
$crystal = 8000000
Config Spi = Hard , Interrupt = On , Data Order = Lsb , Master = No , _
Polarity = High , Phase = 0 , Clockrate = 4
Config Lcdpin = Pin , Db4 = Pina.4 , Db5 = Pina.5 , Db6 = Pina.6 , Db7 = Pina.7 _
, E = Pina.3 , Rs = Pina.2
Config Lcd = 16 * 4
Enable Interrupts
Enable Spi
On Spi Yes
Dim A As Byte
Spiinit
Cls
Home Upper
Lcd " NO SPI"
Home Lower
Do
Wait 1
Loop
End 'end program
'--------------
Yes:
Disable Interrupts
Spiin A , 1
Lcd A
Enable Interrupts
Return
دیدگاه