Hast du schonmal das PRog aus dem Help-File ausprobiert?
Das weicht in sachen Pariety-Bit und Stopbit etc. schon voneinander ab, aber das hängt ja von deinem Terminal-prog ab.
Code:
'----------------------------------------------------------------------
' serin_out.bas
' (c) 2003 MCS Electronics
' demonstration of DYNAMIC software UART
'----------------------------------------------------------------------
'tip : Also look at OPEN and CLOSE
'tell the compiler which XTAL was used
$crystal = 4000000
'tell the compiler which chip we use
$regfile = "2313def.dat"
'some variables we will use
Dim S As String * 10
Dim Mybaud As Long
'when you pass the baud rate with a variable, make sure you dimesion it as a LONG
Mybaud = 19200
Do
'first get some data
Serin S , 0 , D , 0 , Mybaud , 0 , 8 , 1
'now send it
Serout S , 0 , D , 1 , Mybaud , 0 , 8 , 1
' ^ 1 stop bit
' ^---- 8 data bits
' ^------ even parity (0=N, 1 = E, 2=O)
' ^-------------- baud rate
' ^-------------------- pin number
' ^----------------------- port so PORTA.0 and PORTA.1 are used
' ^--------------------------- for strings pass 0
' ^-------------------------------- variable
Wait 1
Loop
End
Lesezeichen