Phone card Reader by com port!! |
This is a Another project but about pc interface . I write this project in vb6. this application read data of a telecard and you can store data in programs. You can read 64 byte data of data of card. For this project we need to a port com. Port com have 9 pins:

D1 d2 d3 all are 5.1v diode zener .circuits is very sample for assembly.sample pcb is proved by proteus :
You can download here. If you need to source code of vb6 you can send email to me. for read of card you must tend to wave chart waveform.
For read serial data of com port and convert to byte , I write a function .in first byte shifted to right then the byte add by ri logic. Result export to function(rx_byte).
Public Function rx_byte() As Integer
Dim k As Integer
Dim retval As Integer
For k = 0 To 7
retval = retval * 2
retval = retval + RI
TXD 1 'clk 1
waitms 10
TXD 0 'clk 0
waitms 10
Next k
rx_byte = retval
End Function
So I need to delay by millisecond value . I can used of sleep API but this API don’t worked true.
I write another sub by timer:
Dim wait1 As Long
Private Sub waitms(ByVal delay1 As Integer)
'delay1 = delay1 / 10
Timer2.Enabled = True
While delay1 > wait1
DoEvents
If Me.Visible = False Then End 'for don’t hang it in exit
Wend
wait1 = 0
Timer2.Enabled = False
End Sub
Private Sub Timer2_Timer()
wait1 = wait1 + 1
End Sub