Shop OBEX P1 Docs P2 Docs Learn Events
SX/B serial comms problem — Parallax Forums

SX/B serial comms problem

Invent-O-DocInvent-O-Doc Posts: 768
edited 2009-04-01 00:11 in General Discussion
I'm having a bit of difficulty with an apparently simple SX/B program. The program sends SEROUT bytes to an XBee device in transparent mode (serial line replacement). The SX 28 runs at 5V and the XBee at 3.3v. The signal from RB.1 goes through a voltage divider to XBee's DATA IN @ 3.2V. Certain bytes make it through, but some consistently do not. Using a full 5V signal from the SX does not make any difference. I'm using 9600 baud 8N1, true and have tried this on more than one module. Any thoughts?

PROGRAM:

DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ 4_000_000
idx VAR Byte
serb VAR Byte
PROGRAM Start
Start:
OUTPUT RB.1
FOR idx = 0 TO 9
serb = 65 + idx
SEROUT RB.1, T9600, serb
PAUSE 100
NEXT
SEROUT RB.1, T9600, 13
GOTO Start

OUTPUT SHOULD BE: ABCDEFGHIJ

ACTUAL OUTPUT: (1st char wont display here)
ÂÃDEFG IJ
ÂÃDEFG IJ
ÂÃDEFG¨IJ
ÂÃDEFG¨IJ
ÂÃDEFG IJ
ÂÃDEFG¨IJ

SX/B version version 1.51.03 onan SX/28

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thomas Talbot, MD
Gunpowder, MD, USA

Comments

  • JonnyMacJonnyMac Posts: 9,412
    edited 2009-03-31 22:59
    You cannot use the internal clock source for serial comms -- it's not stable enough. Add a 4MHz resonator and change the DEVICE line to OSCXT1
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2009-04-01 00:11
    Doh, I didn't see that that tag didn't change! Of course you are right! Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thomas Talbot, MD
    Gunpowder, MD, USA
Sign In or Register to comment.