PDA

View Full Version : BS2 serin,serout.



chick
04-05-2007, 11:48 PM
I have two bs2s attached together for comunication. The program is very simple as yet, but a strange problem exist. When transmitting a var. that is from 1-5, the reciever debug shows 1 as 1, 2 as 0,3 as 1, 4 as 0, 5 as 1.
Odd numbers =1 and even =0

Here are the codes:

transm.

PTNUMBER:
HIGH 1
SEROUT 1,16780,[f,f,f]
PAUSE 10
RETURN

reciev.

PTNUMBER:
SERIN 9,16780,100,MAIN1,[z,j,z]
RETURN


Thanks, Lou

allanlane5
04-06-2007, 12:00 AM
Yeah, you don't want that "HIGH 1" up there -- that will look like a 'start bit' to the recieving device.

The SEROUT command does it's own start bit.

chick
04-06-2007, 12:15 AM
Yes, thank you, I'll remove the high. But I found the problem and it was stupider than you would think. I had the var as a bit. in the main program, changed it to a byte and works fine.

thanks,

Lou