Page 1 of 1

ISRRX issue

Posted: Tue Dec 02, 2008 4:10 pm
by dmtulsa
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?

Posted: Tue Dec 02, 2008 5:05 pm
by Doj
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!

Posted: Tue Dec 02, 2008 5:32 pm
by dmtulsa
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

Posted: Tue Dec 02, 2008 11:29 pm
by Doj
http://hw-server.com/software/termv19b.html#download

This is the latest version of the best terminal software I have ever used.
It does hex, dec and ascii at the same time if you wish.

Posted: Wed Dec 03, 2008 3:07 pm
by dmtulsa
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