Kód: Egész kijelölése
$regfile = "m128def.dat"
$crystal = 14745600
$hwstack = 100
$swstack = 100
$framesize = 100
Dim Bc As Byte
Dim Be(10) As Byte
Dim D As Byte
Dim Buffer As String * 8
Dim Fut As Byte
Config Pinf.0 = Output
Led Alias Portf.0
' Config Pind.2 = Input 'uart2 rxd
' nem, kell
Config Lcd = 20 * 4
Config Lcdpin = Pin , Db4 = Porta.6 , Db5 = Porta.5 , Db6 = Porta.4 , Db7 = Porta.3 , E = Portc.7 , Rs = Portc.6
initlcd
Cls
Cursor Off
' Config Com2 = 19200 , Synchrone = 0 , Parity = None , Stopbits = 1, Databits = 8 , Clockpol = 0
'nem kell, csak ha spec beallitas szukseges....
$baud1=19200
open "COM2" as random as #2
config serialin=buffered, size= 80, bytematch=all
'minden bejovo karaktert jegyezzen (ne legyen adatvesztes), es bejovetelkor a Serial1ByteReceived rutinra ugrik.
'Wait 1'ez minek?
Bc = 0
Fut = 0
'On Urxc1 Uart2
'Enable Urxc1
'ez a srial bufferrel megoldva
Enable Interrupts
Do
If Bc = 8 Then
' Disable Serial'EZ MINEK????? Ami ezido alatt jon, az elveszett! Ezert bufferelek....
Bc = 0
Set Led
Upperline
Lcd Fut
Incr Fut
Reset Led
' Enable Serial
End If
Loop
End
Serial1ByteReceived:
If Bc < 8 Then
Incr Bc
Be(bc) = inkey(#2)
Buffer = Buffer + be(bc)
End If
Return