How to invert OWOUT pin in assembly?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: How to invert OWOUT pin in assembly?

    Thanks for your comments. The output will actually be 3-state: a passive pullup (1K resistor, equivalent to 5mA sink on sensors), active pull down (FET) and active pull up (FET) - the actives with an effective resistance of 100 Ohm = the nominal line impedance. The active pull up is driven by another circuit, based on transition voltage and line sampling, as per the Maxim Application Note. http://pdfserv.maxim-ic.com/en/an/AN244.pdf

    The FET's serve 2 functions:
    - harder pull down and pull up
    - slew rate control (pulse shaping via associated RC).
    In the case of direct pull-down with a PIC pin, we may be able to sink up to 25 mA (much less on some ports of the 18F67K22), but do not have slew rate control (although the internal resistance of the output pin does limit pulse rise/fall time), and the line impedance is less well matched.

    I think the combination of better impedance matching and slew rate control has advantages in long "heavy" networks, so I still want to go for driving the pull down with an inverted OWOUT.

    Your "DEFINE OWINV 1" suggestion sounds promising, I would rather do this than edit the library itself. Any code snippets that would point me in the right direction?

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: How to invert OWOUT pin in assembly?

    Give me a little time, I may be able to find a few minutes here and there to make the mods and test them. But my "DEFINE OWINV 1" comment *** DOES *** involve editing the library. It simply adds a 'switch' that causes OWOUT to be inverted when the define is used, and "in the normal way" when it isn't.

    I have to ask... I have used one wire devices once in the past, and while I think the idea is kind of neat, my opinion is that saving two wires (compared to I2C) is generally not worth it - especially when you start adding special drive circuits. Is there some reason you aren't using I2C?
    Charles Linquist

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: How to invert OWOUT pin in assembly?

    A little more than inverting the OWOUT command ... you would need to change the 1-Wire command into a 3-wire command for AN244.

    Not impossible, but do ya really want to go there ?
    DT

  4. #4
    Join Date
    Jun 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: How to invert OWOUT pin in assembly?

    Well....yes, I do. The application is a big sensor network, partially in a dangerous environment, where for safety reasons current has to be limited. Hence the "parasitic powering" from the 1-wire line. Also for reverse-compatibility with existing, installed sensors.

    Darrel, I take your point. What I am planning is a modified implementation of AN244, with the active pull-up implemented using a separate comparator and PIC (PIC#2). The comparator monitors the line voltage, comparing with a logic threshold reference voltage. When the level on the line rises beyond the threshold voltage (because either the master or a sensor has "let go"), the comparator outputs high. PIC#2 monitors the comparator output, and when it goes high it drives the active pull-up on. The preceding low on the line has been timed by PIC#2, and depending on the combination of the length of the preceding low and whether it has been pulled down by the master (pre OWOUT toggle pin state on main PIC) or by a slave, PIC#2 knows how long to hold the active pull-up.

    The code for the above is regular PBP stuff, no big problem.

    But inverting the OWOUT pin?
    Charles, thanks for the clarification, that makes a lot of sense. In the meantime, I will add an inverting gate on the breadboard and test my code, so that I at least (fingers crossed) have a proof of concept...

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts