General discussion relating to the library modules supplied with the compiler
Moderators: David Barker, Jerry Messina
-
dmtulsa
- Posts: 40
- Joined: Fri Dec 21, 2007 1:38 pm
- Location: Tulsa,OK
-
Contact:
Post
by dmtulsa » 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
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
Works:
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
Any ideas?
Doug
kd5nwk
-
Doj
- Posts: 362
- Joined: Wed Apr 11, 2007 10:18 pm
- Location: East Sussex
Post
by Doj » Tue Dec 02, 2008 5:05 pm
Are you sure its definately a 13?, could there be a 10 instead?
Never heard of there being an issue before but you never know!
-
dmtulsa
- Posts: 40
- Joined: Fri Dec 21, 2007 1:38 pm
- Location: Tulsa,OK
-
Contact:
Post
by dmtulsa » Tue Dec 02, 2008 5:32 pm
I'm sure its CR (13) although I've tried CRLf 13,10 and just LF (10) and all combinations.
I think it the IDE 232 App because other devices won't work with it that need CR or CRLF . Yes I've right clicked the xmit and set the termination char.
I guess I'll have to write a powerbasic or VB6 app so I can see whats really going on by looking at it in hex.
thanks
Doug
kd5nwk
-
dmtulsa
- Posts: 40
- Joined: Fri Dec 21, 2007 1:38 pm
- Location: Tulsa,OK
-
Contact:
Post
by dmtulsa » Wed Dec 03, 2008 3:07 pm
Thank you Mark. Looks like is a very useful program and I like seeing the values in HEX,DEC & STR
It does the same thing as the IDE comm program though. No CRLF even when the box is checked to send it. That said I find it hard to believe its not sending it, same for the IDE's comm program.
It I use Hyper Terminal I get the CRLF fine. I wrote a PowerBasic comm app so I can fully control things and it works fine.
Not sure whats really going on.
thanks for the program and help
Doug
kd5nwk
Doug
kd5nwk