What happens if you clear rxdata after you lcdout the value?
I am thinking . . . . 20 byte array vs 16 byte data . . . maybe shifting . . . no time right now to play with this .
What happens if you clear rxdata after you lcdout the value?
I am thinking . . . . 20 byte array vs 16 byte data . . . maybe shifting . . . no time right now to play with this .
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Joe,
I cleared RxData after LCDout as you suggested with no change in results. Then I tried this addition:
LCDOUT $FE,1
LCDOUT RxData[1],RxData[2],RxData[3],RxData[4],RxData[5], RxData[6]
PAUSE 3000
Results: first pass: BABCDE. second pass: PABCDE
This is even more puzzling.
String display after first pass OPABCDE…Byte display PABCDE
String display screws up two bytes while byte display screws up one byte????
With this change:
hserin 2000,TimeOut , [wait ("A"),str Rxdata\15
LCDOUT $FE,1
LCDOUT RxData[1],RxData[2],RxData[3],RxData[4],RxData[5], RxData[6]
pause 3000
Results:
first pass: ABCDEF “A” should not have been displayed
second pass: CDEFGH
third pass: ABCDEF same as first pass
forth pass: CDEFGH same as second pass
and continues to rotate output data through each pass
If I Rx string then LCDout and END with only one cycle the results are the same ABABCDEF…..
It sounds like RxData IS clearing based on changing first display byte. So it has something to do with hserin RxData “I think”. I added a delay after Tx output with no change in Rx. Still scratching my head...........
By the way, I like your quote from the 1950's. I've passed it on to others.
Hey Moutnain747
What are your HSER defines set to ?
What clock speeds etc , internal or external oscillator ?
PIC's?
Is there anything between the two PIC's ?
Are they wired or wireless ?
Did it all work before ?
Did you try a lower baud rate ?
Think this info may help other help you more :-)
Thought this may help assuming you're running at 20 MHz
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 0 ' 9600 KBaud @ 20MHz, -86.98%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Kind regards
Dennis
Last edited by Dennis; - 13th January 2010 at 00:48.
Post your whole code, RX and TX.
Remember that arrays start at zero [0]
Dave
Always wear safety glasses while programming.
After testing at different Bauds, trying different Hser defines, I found that if I always use a short define string before my needed data all reception is exceptable. Sending a string of “SINKABCDEFG…… and receive with
hserin 2000,TimeOut , [wait("SINK"),str Rxdata\16]
is successful each loop without error. I’ve seen other examples like this and I’m sure it’s a good practice. I’m sending with 16F819 at 8Mhz internal driving a LT108CN RS232 shifter. Resulting in NO errors on Tera Term.
Receive on X1 board, 16F877A at 20Mhz also with LT108CN. Wired connection from bread board w/ F819. My only question now is why this works on receive end:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_BAUD 9600 ' Baud rate
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
And this doesn’t work on receive end with my X1 board:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 0 ' 9600 KBaud @ 20MHz, -86.98%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Thank you guys for all your comments!
Hi Mountain :-)
Glad you're winning !
You left a few things out :-)
Try this
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 12 ' 9600 Baud @ 8MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Hope that helps :-)
Dennis
Bookmarks