PDA

View Full Version : Garbage in serial data stream


ngkdc
09-05-03, 08:52 AM
I'm getting some garbage characters in my code ... sometimes. Here's my code:

DECIMAL 9600 SCI1 BAUD

VARIABLE BUFFER1 DECIMAL 83 ALLOT
BUFFER1 84 SCI1 TXBUFFER
EEWORD

VARIABLE BUFFER2 DECIMAL 83 ALLOT
BUFFER2 84 SCI0 TXBUFFER
EEWORD

VARIABLE BUFFER3 DECIMAL 83 ALLOT
BUFFER3 84 SCI0 RXBUFFER
EEWORD

: CTS1 BEGIN PB0 ON? UNTIL ;
EEWORD
: TX0 YELLED TOGGLE 0 DO DUP 1+ SWAP C@ SCI0 TX LOOP DROP YELLED TOGGLE ;
EEWORD
: TX1 YELLED TOGGLE 0 DO DUP 1+ SWAP CTS1 C@ SCI1 TX LOOP DROP YELLED TOGGLE ;
EEWORD


VARIABLE LOGO
-1 ALLOT
80 ALLOT
LOGO 80 ERASE
CR LOGO 80 EXPECT
Novalidus Group, Inc Advanced Formation Controller System
EEWORD


: CLS DECIMAL 12 SCI1 TX ;
EEWORD
: CRLF DECIMAL 10 SCI1 TX 13 SCI1 TX ;
EEWORD
HEX
: BRIGHT 58 1F ROT ROT ROT SCI1 TX SCI1 TX SCI1 TX ;
EEWORD

: INIT DECIMAL REDLED OFF YELLED OFF CLS 2 BRIGHT ;
EEWORD


INIT
LOGO 60 TX1

If I attempt to imbed LOGO 60 TX1 into the word INIT, I get garbage on my display. If I make a different word defined as LOGO 60 TX1, same result. If I type LOGO 60 TX1 from the keyboard, no problems.

I verified that the garbage is coming from the Isopod, by connecting another terminal to my display (Noritake 4x20 Serial VFD). I solved one issue by creating a Clear To Send (CTS1) that connects to the Noritake busy line ... so I don't overflow the display memory (yea, it can be slow).

The garbage contains the LOGO message, with portions of what appears to be the word that called it.

Any ideas?


Thanks,

Rick

nmitech
09-05-03, 01:39 PM
....
....

HEX
: BRIGHT 58 1F ROT ROT ROT SCI1 TX SCI1 TX SCI1 TX ;
EEWORD

: INIT DECIMAL REDLED OFF YELLED OFF CLS 2 BRIGHT ;
EEWORD

DECIMAL
INIT
LOGO 60 TX1

ngkdc
09-05-03, 02:35 PM
THUD ! ! !

Yes, decimal sure is nicer than hex ... was going 96 decimal into an 80 decimal allocation!

Thank you!

Rick