bascom driver converter
$regfile = "89c51cc.dat"
$crystal = 11059200
$baud = 9600
'52 bit data
Dim D0 As Byte
Dim D1 As Byte
Dim D2 As Byte
Dim D3 As Byte
Dim D4 As Byte
Dim D5 As Byte
Dim D6 As Byte
Dim D7 As Byte
Dim D8 As Byte
Dim D9 As Byte
Dim D10 As Byte
Dim D11 As Byte
Dim D12 As Byte
Dim D13 As Byte
Dim Isi As String * 3
Dim I As Integer
Dim X As Integer
Declare Sub Baca
Datax Alias P0.3
Clock Alias P0.1
Req Alias P0.2
Print "TESTER"
Do
Req = 0
Clock = 1
Input Isi Noecho
If Isi = "1" Then
' Print "baca sekali"
Call Baca
End If
If Isi = "2" Then
Print "baca 100 kali"
For X = 1 To 100
' Waitms 200
Call Baca
Next X
End If
Loop
Sub Baca:
Req = 1
For I = 1 To 13
D0 = 0
Bitwait Clock , Reset
D0.0 = Datax
Req = 0
Bitwait Clock , Set
Bitwait Clock , Reset
D0.1 = Datax
Bitwait Clock , Set
Bitwait Clock , Reset
D0.2 = Datax
Bitwait Clock , Set
Bitwait Clock , Reset
D0.3 = Datax
Bitwait Clock , Set
D13 = D12
D12 = D11
D11 = D10
D10 = D9
D9 = D8
D8 = D7
D7 = D6
D6 = D5
D5 = D4
D4 = D3
D3 = D2
D2 = D1
D1 = D0
Next I
D0 = Inkey
D0 = Inkey
D0 = Inkey
Print D9 ; D8 ; D7 ; D6 ; D5 ; "," ; D4 ; D3
End Sub