فایل لازم در ادامه
این مدار خیلی ساده هست و کیفیت خوبی هم داره و شماتیک و برنامه هم گویای همه چیز هست
دوستان برنامه رو همین جوری میزارم که با اپلود سنتر ها مشکلی نداشته باشین
در ضمن دوستان این کار رو به هیچ وجه خودم انجام ندادم ولی همه چیز رو چک کردم و هیچ مشکلی نداره
\'-------------------------------------------
\' Final Program Of Chipcorder
\'-------------------------------------------
$regfile = \"m8def.dat\"
$crystal = 8000000
\'-------------------------------------------
Enable Interrupts
Enable Int0
Enable Int1
Config Int0 = Falling
Config Int1 = Rising
On Int0 Exint0
On Int1 Exint1
\'-------------------------------------------
Config Keyboard = Pind.7 , Data = Pind.6 , Keydata = Keydata
Config Portc = Output
Config Portb = &B00111100
Config Portd = &B00010011
\'-------------------------------------------
Dim A1 As Word , A3 As Word , A4 As Word , A5 As Word , A6 As Word
Dim A7 As Word , A8 As Word , A9 As Word , B1 As Word , B2 As Word
Dim B3 As Word , B4 As Word
Dim B5 As Byte , A2 As Byte , B6 As Byte
Dim S As String * 5
\'-------------------------------------------
B5 = 0
B6 = 0
S = \"\"
\'-------------------------------------------
Do
A1 = Getatkbd()
If A1 = 13 Then
A2 = Len(s)
S = Mid(s , 1 , A2)
A3 = Val(s)
A4 = A3 And 1
A4 = Low(a4)
A5 = A3 And 2
Rotate A5 , Right
A5 = Low(a5)
A6 = A3 And 4
Rotate A6 , Right , 2
A6 = Low(a6)
A7 = A3 And 8
Rotate A7 , Right , 3
A7 = Low(a7)
A8 = A3 And 16
Rotate A8 , Right , 4
A8 = Low(a8)
A9 = A3 And 32
Rotate A9 , Right , 5
A9 = Low(a9)
B1 = A3 And 64
Rotate B1 , Right , 6
B1 = Low(b1)
B2 = A3 And 128
Rotate B2 , Right , 7
B2 = Low(b2)
B3 = A3 And 256
Rotate B3 , Right , 8
B3 = Low(b3)
B4 = A3 And 512
Rotate B4 , Right , 9
B4 = Low(b4)
Portc.5 = A4 : Portc.4 = A5 : Portc.3 = A6 : Portc.2 = A7
Portc.1 = A8 : Portc.0 = A9 : Portb.5 = B1 : Portb.4 = B2
Portb.3 = B3 : Portb.2 = B4
Waitms 1
S = \"\"
If B5 = 0 Then
Portd.1 = 0
Waitms 50
Portd.0 = 1 : Portd.4 = 0
Waitus 10
Portd.4 = 1
Aa:
If B6 = 0 Then Goto Aa
B6 = 0
Portd.1 = 1
End If
If B5 = 1 Then
Portd.1 = 0
Waitms 50
Portd.0 = 0
Bb:
If Pinb.0 = 1 Then Goto Bb
Portd.4 = 0
Dd:
If Pinb.0 = 0 Then Goto Dd
Portd.4 = 1
Portd.1 = 1
B5 = 0
End If
Else
S = S + String(1 , A1)
End If
Loop
End
\'---------------------------------------------
Exint0:
B6 = 1
Return
\'---------------------------------------------
Exint1:
If Pinb.1 = 0 Then
B5 = 1
Else
Portd.4 = 0
Waitms 2
Portd.4 = 1
Portd.1 = 1
End If
Return
\'---------------------------------------------
Keydata:
Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , &H5E , 0
Data 0 , 0 , 0 , 0 , 0 , 113 , 49 , 0 , 0 , 0 , 122 , 115 , 97 , 119 , 50 , 0
Data 0 , 99 , 120 , 100 , 101 , 52 , 51 , 0 , 0 , 32 , 118 , 102 , 116 , 114 , 53 , 0
Data 0 , 110 , 98 , 104 , 103 , 121 , 54 , 7 , 8 , 44 , 109 , 106 , 117 , 55 , 56 , 0
Data 0 , 44 , 107 , 105 , 111 , 48 , 57 , 0 , 0 , 46 , 45 , 108 , 48 , 112 , 43 , 0
Data 0 , 0 , 0 , 0 , 0 , 92 , 0 , 0 , 0 , 0 , 13 , 0 , 0 , 92 , 0 , 0
Data 0 , 60 , 0 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0
Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0
Data 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
Data 0 , 0 , 0 , 0 , 0 , 81 , 31 , 0 , 0 , 0 , 90 , 83 , 65 , 87 , 34 , 0
Data 0 , 67 , 88 , 68 , 69 , 0 , 35 , 0 , 0 , 32 , 86 , 70 , 84 , 82 , 37 , 0
Data 0 , 78 , 66 , 72 , 71 , 89 , 38 , 0 , 0 , 76 , 77 , 74 , 85 , 47 , 40 , 0
Data 0 , 59 , 75 , 73 , 79 , 61 , 41 , 0 , 0 , 58 , 95 , 76 , 48 , 80 , 63 , 0
Data 0 , 0 , 0 , 0 , 0 , 96 , 0 , 0 , 0 , 0 , 13 , 94 , 0 , 42 , 0 , 0
Data 0 , 60 , 0 , 0 , 0 , 0 , 8 , 0 , 0 , 49 , 0 , 52 , 55 , 0 , 0 , 0
Data 48 , 44 , 50 , 53 , 54 , 56 , 0 , 0 , 0 , 43 , 51 , 45 , 42 , 57 , 0 , 0
\'----------------------------------------------