Shop OBEX P1 Docs P2 Docs Learn Events
Serial Communication — Parallax Forums

Serial Communication

kingnebkingneb Posts: 65
edited 2005-11-01 22:27 in General Discussion
What is an Ideal SX program for an SX18 that sends the value of the rb port via the serout command? One that recieves serial data for an SX28? Would this work?


'SX18 code

start:

serout ra.0, 9600, rb

goto start






'SX28 code

x var byte

start:

serin ra.0, 9600, x

rb = x

goto start



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Too many lies from the right, which is the wrong side of the tracks.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-01 21:29
    No, it won't work. You cannot specify the baud as you're doing (no mode indicated)·-- the help file is very clear on this point and there are lots of demo bits (I even posted some today) for serial I/O with SX/B.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 11/1/2005 9:34:10 PM GMT
  • kingnebkingneb Posts: 65
    edited 2005-11-01 21:59
    Oops, forgot to specify the mode, T for non-inverting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Too many lies from the right, which is the wrong side of the tracks.

    Post Edited (kingneb) : 11/1/2005 10:04:56 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-11-01 22:27
    Had you run that snippet through the compiler (hint, hint) instead of posting it that would have become apparent.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.