Shop OBEX P1 Docs P2 Docs Learn Events
serial communication with com port, higher speed needed... — Parallax Forums

serial communication with com port, higher speed needed...

avionikerenavionikeren Posts: 64
edited 2008-02-17 18:43 in BASIC Stamp
I have a BS2 that is recieving data from the com port at 4800baud and if I try to use faster speed the data recieved would be wrong... Can I use higher speed if I use the dedicated SIN, Rpin = 16 ?· I tried that, but could not make it work at all, but is it correct to use pin 16 as it says in the editors help, pin 16 is for SEROUT too...?

Comments

  • terry_bearterry_bear Posts: 84
    edited 2008-02-17 15:16
    avionkeren,

    If I understand your post correctly, it would seem that the problem is not within the Stamp. Using pin 16 will effectively be the same as using DEBUG.

    Are using a PC to send data to the Stamp? If so, are you referring to the COM port on the PC? Did you remember to change the baudrate on the device (whether it is a PC or something else entirely) that is sending data to the Stamp?

    Hope this helps,

    Terry
  • avionikerenavionikeren Posts: 64
    edited 2008-02-17 16:42
    Yes I am using a pc·to send data to the stamp, and I have set up the com port and the SERIN baudrate to the same. It works perfect at all baudrates below 4800... but when I try at 9600bps the variables I send change to wrong values...cry.gif
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-17 17:00
    If you read the manual in the chapter on the SERIN command, you'll see that input at speeds above 2400 Baud can be unreliable. This is because of the time required to set up for the command within the PBasic interpreter and to set up for each operand. Solutions are:
    1) Use the lower speed
    2) Switch to a faster Stamp model, like the BS2p or BS2px
    3) Use an external serial input buffer like this: www.proteanlogic.com/product_periph_rs232.shtml
  • Tom CTom C Posts: 461
    edited 2008-02-17 18:43
    avionikeren,

    If you want serial receive rates of greater than 9600 baud, you will have to upgrade to at least a BS2p Stamp and use the code from the following thread:

    http://forums.parallax.com/showthread.php?p=693200

    Hint: If would do a search before you post a thread, you might answer your own question.

    Regards,
    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
Sign In or Register to comment.