Shop OBEX P1 Docs P2 Docs Learn Events
Connecting open drain output to another output of PIC — Parallax Forums

Connecting open drain output to another output of PIC

HasanHasan Posts: 10
edited 2005-03-31 16:43 in General Discussion
Hi,
Here is a question to all of you PIC experts from a half engineer.

I have a project where I have a bunch of slave controllers/sensors based on PICs connected to a central controller which is based on Javelin Stamp. One of these slave controllers is a ultrasonic ranger used to sense fluid level. This ranger is designed around pic16f628. Skipping the irrelevant design details here, this PIC has a couple of comparators which I use at the last stage of the ultrasonic reflected pulse detector. Compartor's output is digital and is open drain. Here is the quesiton.

I want to connect this open drain output to another port pin which is always output in my case (CCP1/RB3 pin). Will this be OK? i.e., connecting an open drain output to another regular, non-open drain output? I know two or more open drains can be connected together thru a resistor to Vcc but not sure about mixing the two types of outputs.

Also, the data sheet says that "If the RB3/CCP1 is configured as an output, a write to the port can cause a capture condition." This is good news for me since I don't have to change status of ccp1 pin. Does any one have an idea how this writing to output, works?

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-03-29 08:47
    The Art of Electronics explains how open-drains are properly interfaced.
    You really need to work through all the appropriate cases they present in order to avoid a bad result.

    I would have to go back to the book and guess what you want to do. Try to locate a copy at your library and I am sure it will clear up your questions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-03-29 15:09
    If you need the driven output for other parts of your circuit and can't change it in software, a diode connected off the pin will "approximate" the functionality
    of an open collector for the parts of your circuit that are already open collector.

                         10K
           +5V >---------/\/\----o
                                 |
                                 |
    Output Pin >-----o------|<---o------> Open Collector Output with pullup
                     |
                     o------------------> Driven Output
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • HasanHasan Posts: 10
    edited 2005-03-29 16:02
    Hi,
    Thanks for the replys guys.

    I do have the Art of Electronics Book. I couldn't find the solution to my problem in it though.

    ICeMAN's simple solution will actually work for me. I should have thought of that too...

    How do you draw these ascii based circuit diagrams?

    -Hasan
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2005-03-29 16:24
    Hasan said...

    How do you draw these ascii based circuit diagrams


    I usually draw them in Windows Notepad (non-proportional font)

    Then cut and past them into a reply as if they were CODE.

    {code}
    ASCII Stuff
    {/code}


    Substitute { and } with [noparse][[/noparse] and ]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    Latest Company News
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-03-31 16:43
    I believe it is in The Art of Electronics under 'open collector' not 'open drain' [noparse][[/noparse]I maybe wrong].
    I knew that possibly both diodes and pull up resistors were required, but unsure of the logic.

    Thanks for the tip on ASCII schematics. Having seen a lot of those, I really appeciate knowing how easy they are to create.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
Sign In or Register to comment.