- 阅读权限
- 100
- UID
- 45
- 帖子
- 31
- 精华
- 0
- 注册时间
- 2013-2-27
- 在线时间
- 29 小时
- UID
- 45
- 帖子
- 31
- 精华
- 0
- 注册时间
- 2013-2-27
- 在线时间
- 29 小时
|
$regfile = "m16def.dat" '
$crystal = 8000000 '8M晶振频率
$hwstack = 32 '设置堆栈大小
$swstack = 10
$framesize = 40
Dim I As Byte
Dim A(10) As Byte
Ddrc.4 = 1
Ddrc.3 = 1
Ddrc.6 = 1
Dain Alias Portc.4
Ce Alias Portc.6
Sck Alias Portc.3
Ce = 1
'Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 4 , Noss = 0
'Spiinit
Dim S As Byte
Restore Daima
For I = 1 To 10
Read A(i)
Next
Do
nop
'Spiout A(i) , 1
Shiftout Dain , Sck , A(i) , 1
Ce = 0
Waitms 150
Ce = 1
Incr I
If I > 10 Then
I = 1
End If
'Ce = 1
Loop
Daima:
Data &B11000000 , &B11111001 , &B10100100 , &B10110000 , &B10011001
Data &B10010010 , &B10000010 , &B11111000 , &B10000000 , &B10011000
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
|