Shop OBEX P1 Docs P2 Docs Learn Events
Meaning of the mode bits in FullDuplexSerial? — Parallax Forums

Meaning of the mode bits in FullDuplexSerial?

simonlsimonl Posts: 866
edited 2009-05-05 19:55 in Propeller 1
I'm wondering what the "open drain/source tx" bit actually means (in FullDuplexSerial). Anyone able to shed some light?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon

www.norfolkhelicopterclub.com

“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2009-05-05 13:05
    open drain/source tx means that the propeller does not set this line to high. High has to be generated by the line itself - or the receiver, so for example with a pull up resistor. The propeller is only driving this line in case it sends a low bit. This is to prevent shorts in case the line is bidirectional. For example you could connect RX and TX in this mode having only one line. Of course only one device can send, the other has to receive. You have to ensure this by a higher level protocol. But even if both are sending, you won't have a short, because the line is only driven high with a resistor.
  • simonlsimonl Posts: 866
    edited 2009-05-05 13:09
    Hey MagIO2, that's an excellent explanation - just what I was looking for. Many thanks smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    “Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-05-05 13:19
    Ok ... even if you now understood:

    I now understood as well burger.gif· the open drain/source part
    In case the invert bit is also set, it's the other way around. The line itself should be pulled down to low and the propeller has to push it to high level.
    Driving line high with resistor is called open drain, driving the line low with resistor is called open source.

    How does that work for both cases?
    Well, the TX pin is not permanently an output-pin. The code only sets the dira-bit of the TX pin to 1, if the line needs to be driven by the prop and sets the dira-bit to 0 if the pushup/pulldown resistor should do its job ;o)

    Post Edited (MagIO2) : 5/5/2009 1:28:33 PM GMT
  • simonlsimonl Posts: 866
    edited 2009-05-05 19:55
    @MagIO2: That's even clearer - thanks!

    Actually, this has helped me even more - just this morning I was wondering if FullDuplexSerial could be made to do simplex comm's (Tx & Rx share one wire, and Tx/Rx is one way at a time). Now I know it can smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    “Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
Sign In or Register to comment.