ISRRX issue
Posted: Tue Dec 02, 2008 4:10 pm
I'm not sure if this is a ISRXX issue or a serial communicator problem but
if I set the serial communicator to terminate with CR (13) then check ISRXX.Databyte = 13 it is never true.
if I send something else like "$" (36) then check ISRXX.Databyte = 36 it is true.
doesn't work
Works:
Any ideas?
if I set the serial communicator to terminate with CR (13) then check ISRXX.Databyte = 13 it is never true.
if I send something else like "$" (36) then check ISRXX.Databyte = 36 it is true.
doesn't work
Code: Select all
Device = 18F452
Clock = 20
//includes
Include "USART.bas"
Include "ISRRX.bas"
Dim Rdata As String
Dim StrReady As Boolean
Sub OnData ()
PORTD.7 =1
If ISRRX.DataByte = 13 Then
StrReady = true
Else
PORTD.7 =0
EndIf
End Sub
' program start...
USART.SetBaudrate(br115200) // set uart buad rate
ISRRX.Initialize(@OnData) // on int goto ondata
TRISD=0
StrReady = false
While True
DelayMS (500)
Toggle(PORTD.6)
If StrReady = true Then
PORTD.7 =0
StrReady = false
ISRRX.ReadStr(Rdata,13)
USART.Write(Rdata,13)
EndIf
Wend
Code: Select all
Device = 18F452
Clock = 20
//includes
Include "USART.bas"
Include "ISRRX.bas"
Dim Rdata As String
Dim StrReady As Boolean
Sub OnData ()
PORTD.7 =1
If ISRRX.DataByte = 36 Then
StrReady = true
Else
PORTD.7 =0
EndIf
End Sub
' program start...
USART.SetBaudrate(br115200) // set uart buad rate
ISRRX.Initialize(@OnData) // on int goto ondata
TRISD=0
StrReady = false
While True
DelayMS (500)
Toggle(PORTD.6)
If StrReady = true Then
PORTD.7 =0
StrReady = false
ISRRX.ReadStr(Rdata,36)
USART.Write(Rdata,13)
EndIf
Wend