USING pcFullDuplexSerial4FC.spin-Mis reading
Chuck Minton
Posts: 45
Thanks to those helping with my bit problem shift problem.
Now onto my next issue...in new thread
I am trying to implement a display that has integral buttons. When a button is pushed, the display sends a serial packet. for instance the notification packet when the left button is pushed is supposed to be $80 01 03 63. Using ParallaxSerialTerminal I get 100% of button push all the time. However, because I was out of cogs, forum suggestions pointed to the PCFullDuplexSerial4FC. I got that going, but now I don't get proper reading from my serial sources but It sees to transmit well. Most of the time I rx the first byte right , then the second and third byte seems to be usually wrong(but quasi consistent), and the forth byte is always right. I am thinking there must be a timing issue ... why else would PST read right all the time... none the less it did free up a cog! I will be able to fit it all on one prop!
The good part is if I can figure this out, I will be more or less to the completion point of my project... getting so close!
I tried switching baud from 115200 to 19200 ( my only options)... That was worse ... could write but would not read it at all.
So, If any one is up on PCFullDuplexSerial4FC, and what may be causing this and how I could fix it I would appreciate it a whole lot.
(Using a Crystal Fontz Logic Level display)
Thanks ,
Chuck
Now onto my next issue...in new thread
I am trying to implement a display that has integral buttons. When a button is pushed, the display sends a serial packet. for instance the notification packet when the left button is pushed is supposed to be $80 01 03 63. Using ParallaxSerialTerminal I get 100% of button push all the time. However, because I was out of cogs, forum suggestions pointed to the PCFullDuplexSerial4FC. I got that going, but now I don't get proper reading from my serial sources but It sees to transmit well. Most of the time I rx the first byte right , then the second and third byte seems to be usually wrong(but quasi consistent), and the forth byte is always right. I am thinking there must be a timing issue ... why else would PST read right all the time... none the less it did free up a cog! I will be able to fit it all on one prop!
The good part is if I can figure this out, I will be more or less to the completion point of my project... getting so close!
I tried switching baud from 115200 to 19200 ( my only options)... That was worse ... could write but would not read it at all.
So, If any one is up on PCFullDuplexSerial4FC, and what may be causing this and how I could fix it I would appreciate it a whole lot.
(Using a Crystal Fontz Logic Level display)
Thanks ,
Chuck
Comments
I can send to the display perfect all the time.
I am having trouble reading from the display: When a button is pushed, it is supposed to send a packt to the prop telling what button was pushed.
Using PST it works great.
Using PCFullDuplexSerial4FC, because I am out of cogs, I don't get proper read of the packet coming into the prop from the display.
The first and last bytes are always right, but the center two are usually wrong and vary a little.
I have hooked the display directly up to my prop clip and into terminal . That reads fine.
The problem happens using PCFullDuplexSerial4FC, which I need to do to free up cogs.
for instance:
this is the read from the left button:$80 80 81 63
this is what the display is sending : $80 01 03 63
switch back to pst and does it fine.
I see in Comments,"''* Tested 4 ports to 115Kbps with 6MHz crystal ".
I am using 5Mhz X-tal @ PLL 16X.. could this be an issue.
Also other stirng someone suggested nudgeing baud rate a little in FullDuplexSerial, is this possible with this code??? I wonder if the freq of the dispaly is off a little.
On scope, both seem to be strong and same pitch: Can't tell for sure...not a storage scope.
My guess is if you look at the timing from the last bit of the 1 char to the 1st of the 2nd, etc for each char the last char has a slightly longer time. So you are starting late into the char with the 2nd and 3rd chars
Sounds good for me, how is that accomplished,
can I just change the Constants???
BAUD1200 = 1200
BAUD2400 = 2400
BAUD4800 = 4800
BAUD9600 = 9600
BAUD19200 = 19200
BAUD38400 = 38400
BAUD57600 = 57600
BAUD115200 = 115200 <<<<
...a little higher or a little lower???
TNX...
I had to step up the 4port to 117000 <>124000 and works GREAT!
Things qiut working at all at 111000
So probably set at 118000
Thanks so much for the help Timmoore!