This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Setting a Port Pin to 0 on Power ON

I would like to set a port pin for example P1.7 to zero "0" on "Power On" condition. I would like to do it in init.a51 or startup.a51. Please let me know how to do it?

I am using keil UV2.37. Compiler 7.05



regards
Ganesh

  • this is the old classic. I guess a realy clatters at power on.

    1) there is no way to set a pin low during reset.
    2) add an inverter to fix it
    3) if whatever is connected to the pin is dead slow setting the pin low at startup1 may do it for you.

    Erik

  • "3) if whatever is connected to the pin is dead slow..."

    Wouldn't a relay count as "dead slow" in this context?

  • "I would like to do it in init.a51 or startup.a51. Please let me know how to do it?"

    There is absolutely nothing special nor magic about startup.a51 - it's just an assembler source file like any other assembler source file.
    Thus, the way to control a port pin in startup.a51 is no different to the way to do it in any other assembler source file.

  • Wouldn't a relay count as "dead slow" in this context?
    I have run relays on when pin high using the following
    1) a supervisor that reset for the required time and no more
    2) Pn.n = 0 as the first instruction after the jump at 0.

    Of course, this excludes things like wide tolerance supervisors and RC resets.

    Erik