Keep DIO from toggling


Closed Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    74

    Default Keep DIO from toggling

    Is there a way to keep the Digital outputs on a 18F4520 from changing states when the pic gets reset with a MCLR? I don't remember this happening on my other pic projects with 16F series.

    My issue is the pic controls relays which controls valves and solenoids and I really need to keep them in a known state and not change states during a reset.

    Outputs are setup to sink, Like this 24 volts to Relay Coil, Relay coil to Transistor, Transistor goes to ground. Digital Out controls transistor. No pull ups or downs.
    Example Pin, RC3

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    On reset, all pins go to inputs, so if you have them 'pulled' to a default state (or at least a 'fail-safe/operational' state) with a pullup/pulldown, you should be ok. Then you can read the last state stored in eeprom, set the logic level on the pins, and change the pins to outputs as required. I would think it should be relatively easy to patch in a few pullup/pulldown resistors to a pin or two here and there.

    Past that, sounds like some battery backup would be needed, or maybe some external latching relays.

Similar Threads

  1. PULSOUT versus toggling a pin
    By RussMartin in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th January 2010, 15:59
  2. toggling bits
    By tazntex in forum General
    Replies: 2
    Last Post: - 5th February 2008, 22:42
  3. SERIN SERIN2 Timeout
    By markedwards in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd June 2005, 18:59

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