Shop OBEX P1 Docs P2 Docs Learn Events
Serial Comunication using prop. — Parallax Forums

Serial Comunication using prop.

John BoardJohn Board Posts: 371
edited 2012-02-14 09:06 in Propeller 1
Hi everyone.

I haven't done much SPIN for quite a while, expecially with serial comms. Can anyone help me convert this to SPIN (Using the FullDuplexSerial) library:
SEROUT 5, 84, [$80,2,2]

Its not the pin and baud that I'm worried about, its more how to send a number of seperate bytes at once that I don't quite know how to do. Can anyone help?

I am aquanted how to set up the object, init it etc, its just sending the bytes.

Thanks,

John

Comments

  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-02-10 22:42
    fds.str(string($80, 2, 2))
    
    or
    fds.tx($80)
    fds.tx(2)
    fds.tx(2)
    
  • John BoardJohn Board Posts: 371
    edited 2012-02-10 22:51
    Thanks, so if you wish to send multiple bytes in a stream you use string(params)?
  • JonnyMacJonnyMac Posts: 9,197
    edited 2012-02-10 22:58
    So long as none of your bytes is zero; this value is the string terminator.
  • John BoardJohn Board Posts: 371
    edited 2012-02-10 23:25
    Thanks for your help, funnily enough I did actually have the right code to begin with (3 sets of .tx()), however I had my out pin wrong... I really ought to check all contigencies in future before wasting poeple's time on the forums.
  • FORDFORD Posts: 221
    edited 2012-02-14 05:51
    So is the "fds." a call to a separate serial object, or is it part of spin ?
  • JonnyMacJonnyMac Posts: 9,197
    edited 2012-02-14 09:06
    FullDuplexSerial (FDS) is a separate object. The UART code is written in PASM (Propeller Assembly); the interface to the UART code is, of course, in Spin. FullDuplexSerial is in the library with the installation of the Propeller Tool.
Sign In or Register to comment.