Shop OBEX P1 Docs P2 Docs Learn Events
A bug in FullDuplexSerial? — Parallax Forums

A bug in FullDuplexSerial?

Robin AnderssonRobin Andersson Posts: 3
edited 2008-04-04 23:50 in Propeller 1
I don't know if it's me that's doing wrong but I just can't figure this out by my self.
I am trying to use the FullDuplexSerial object. It's works great accept one little thing.

Here is a simple program to demonstrate my problem.

CON
  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

OBJ
  text : "tv_text"
  serial : "FullDuplexSerial"
PUB start | serinp
  text.start(0)
  serial.start(31,30,0,9600)
  repeat
    serinp := serial.rx
    text.out(serinp)


·All this does is to grab a byte from serial port on pin·31 and print it to the screen (pin 0 - 3). Then·I start hyper terminal and connect to the com port with 9600 baudrate, 8 bits, no parity,1 stopbit and·no flow controll. If I type on my keyboard it's happen on my screen. Even backspace and return works. But it's·when i type more than two of the same letter·after·each other·it is getting werd.
Say if I type "aaa" the screen shows me "aaá" and if i type "aaaaaaaa" this is what happens "aaáaáaá".
"vvvvvvv" gives me "vvövövöv" and so on.

Is it me that doing this all wrong or are there realy a bug in the serail object??

(ps. a have tryed to do serial.rxflush at the end of the repeat loop, but without results.)


Post Edited (Robin Andersson) : 4/4/2008 10:11:20 PM GMT

Comments

  • Ken PetersonKen Peterson Posts: 806
    edited 2008-04-04 23:13
    Quit typing so many of the same character in a row!

    but seriously...does it matter how fast you type the characters?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-04-04 23:15
    Just a hunch....try defining serinp as a byte in your VAR section.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Robin AnderssonRobin Andersson Posts: 3
    edited 2008-04-04 23:33
    Defining serinp as a byte in the VAR section didn't help.

    And it dosent matter how fast or slow·i type it. I·can type letter with several minutes betwen and·I still get same result.
    And for·your notice, the·final use for the program is not·ment to be me that send commands. It's supposed to be a simple protocoll between my computer and the propeller to let the computer controll the propeller's system.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-04 23:45
    FullDuplexSerial is buffered (16 characters) and shouldn't have a problem with typing quickly. I suspect that there's a problem with the PC's (Hyperterminal's) Baud setting or even the Prop's crystal. I don't see anything wrong with your program. If the Prop's clock or the PC's Baud setting are off, they can get out of sync after a couple of characters. If you can type single characters or pairs of characters and it all works fine as long as there's a slight pause between the individual or pairs of characters, then that's your problem.

    It's unlikely that the Prop is off in its timing because then the TV output wouldn't work ... that's very sensitive to timing.
  • Robin AnderssonRobin Andersson Posts: 3
    edited 2008-04-04 23:50
    Okey, but when i rapidly type a lots of characters in a row rapidly and fast it works fine. i.e "kjfdlhgbfkhdshfgewhyfgjgsfdsa" <
    If i type that within a second theres no problem. So the timing between the PC and propeller dosen't seems to be the problem. Maby it is only me that have this problem?

    Thanks for the quick response!
Sign In or Register to comment.