Shop OBEX P1 Docs P2 Docs Learn Events
Prop UART code with RTS & CTS? — Parallax Forums

Prop UART code with RTS & CTS?

Shane De CataniaShane De Catania Posts: 67
edited 2013-04-25 03:57 in Propeller 1
Hi All,
Can anyone help me with code or a link to propeller UART object that implements RTS and CTS as well as the usual RXD and TXD?
Cheers,
Shane.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-05 05:35
    No one has posted a UART object that implements RTS and CTS. Sorry.

    If you don't need the buffering of FullDuplexSerial, it would be very easy to add
    RTS/CTS handling to the Simple_Serial driver. You could do that yourself.

    If you need the buffering, you'd have to study the assembly language driver portion
    of FullDuplexSerial and add the RTS/CTS handling there (or somehow talk someone
    into doing it for you).
  • Shane De CataniaShane De Catania Posts: 67
    edited 2007-04-05 08:36
    Thanks mike - although that's not the answer I was looking for!
    I'm still getting my head around spin code at the moment, so it will probably be a while before I am confidently modifying other peoples assembly code - although I must say the a lot of it is quite well documented and reasonably understandable.
    If any body is interested in adding RTS & CTS to FullDuplexSerial I would be internally greatfull by the way wink.gif
    Cheers,
    Shane.
  • bambinobambino Posts: 789
    edited 2007-04-05 13:28
    Not that I have the time, I don't. But a future project would make use of handshaking. I don't know the dance steps to when I do get the time.
    While we are on the subject could someone show what's going on with the CTS&RTS lines between Bytes?
  • bambinobambino Posts: 789
    edited 2007-04-05 13:37
    If I could remember how to use the search engine I do recall one post about 3 or 4 months back about someone using FullDuplexSerial with Handshaking.
  • simonlsimonl Posts: 866
    edited 2007-04-05 15:25
    Is this (http://forums.parallax.com/forums/default.aspx?f=25&m=145730) the thread you're referring to bambino?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon

    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif

    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
  • bambinobambino Posts: 789
    edited 2007-04-06 12:17
    somonl,
    No, As good as I can remember the title of the thread was "FullDuplex with Handshaking"
    What is the ULR of the parallax search engine?
  • oodesoodes Posts: 131
    edited 2013-04-23 03:57
    Has anyone managed to incorporate RTS/CTS flow control? Im using the full duplex serial object to talk to a Printer, but I need to incorporate the Hardware flow control. Im using the MAx3223 chip and Im unsure on how to minterface the RTS/CTS lines with the propellor chip. Any ideas?

    Thanks
    Des
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-04-23 04:21
    Here is a version of FDX that I modified for CTS a couple of years ago. I never tested it, so it comes as is.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-04-23 04:22
    Here is a version of FDX that I modified for CTS a couple of years ago. I never tested it, so it comes as is.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-04-23 08:54
    FullDuplexSerial4port.
    [SIZE=1][FONT=courier new]AddPort(port,rxpin,txpin,[COLOR=#020FC0]ctspin,rtspin,rtsthreshold,[/COLOR]mode,baudrate)
    
    [/FONT][/SIZE]
    
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-04-23 14:48
    Thanks Tracy. At least I'll now know this for the future :)
  • oodesoodes Posts: 131
    edited 2013-04-24 02:24
    Thanks Guys ,
    I'm in the Process of converting my program from the FullDuplexSerial to FullDuplexSerial4 port. I can get the PST up and running but I'm also trying to get comms with a Printer. I can't seem to Transmitt Data to the Printer. Can I run these from the same Port or do i need a separate Port for each. After adding in CTS and RTS and one port Pin , im maxed out on pins. Sorry for the silly Question but what is the function of using a Port pin as opposed to not using one on original FullDuplexSerial

    Regards
    Des
  • oodesoodes Posts: 131
    edited 2013-04-24 04:34
    Ok, Ignore that last Question :P

    Making some Progress. :D
  • oodesoodes Posts: 131
    edited 2013-04-24 14:04
    Tracy,

    If I invert CTS in the mode parameter of AddPort , will tx wait if CTS is low? The printer I'm interfacing has RTS on High when ready for Data which I'm going to connect to the CTS pin on the Propellor . In the Demo2 spin file I'm referring to the comment on Line 170 '' cts is enabled, tx will wait if cts is high ", I just need to flip this .

    Thanks for the Help

    Des
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-04-24 17:11
    It depends on how many inversions it goes through on its way between printer and prop. Usually, but not always, non-inverted mode on the tx/rx lines goes along with non-inverted mode on the cts/rts lines. In the demo, the mode is non-inverted on both tx and cts, so tx stop bits and the cts stop condition are both a high level.
    In answer to your question, yes, changing the cts mode bit 0 to 1 will cause it to wait when cts is low, independent of the mode for tx. The cts mode bit is highlighted in red below.
    [SIZE=1][FONT=courier new]fds.AddPort(A_PORT, -1, A_TXPIN, A_CTSPIN,-1, 0, %0[COLOR=#ff0000][SIZE=1]0[/SIZE][/COLOR]0000, abBaud)
                          ' tx but no rx,
                          ' cts is enabled, tx will wait if cts is high
    [/FONT][/SIZE]
    
  • oodesoodes Posts: 131
    edited 2013-04-25 03:57
    Cheers Tracy ,

    Got that up and running this morning , happy days.

    Regards
    Des
Sign In or Register to comment.