Shop OBEX P1 Docs P2 Docs Learn Events
pins go high during start & download ?? — Parallax Forums

pins go high during start & download ??

LloydsLloyds Posts: 75
edited 2010-08-29 14:04 in BASIC Stamp
Hi,
I am using a ZVN4206AV MOSFET to drive a relay. I have a 10k resistor between the gate of the mosfet and the stamp pin. When the stamp pin goes high, it turns on the mosfet and energizes the relay.

The problem is that during program download and also when I initially turn the power to the stamp on, the stamp pin seems to go high and energize the relay.

Do the stamp pins normally go high during power up?

Thanks for any help.
Lloyd

Comments

  • LeonLeon Posts: 7,620
    edited 2010-08-29 13:32
    With MCUs pins are generally inputs following a reset, and could float to a high state. Connecting the gate to ground through a resistor will prevent it turning on.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-29 13:40
    Write a line to send that output pin LOW at the start.
  • LloydsLloyds Posts: 75
    edited 2010-08-29 13:56
    WoW!
    Thanks for the quick responses.
    I put a 10k (maybe I'll try a higher value) resistor from the gate to ground and it prevented the unwanted turn-on during power-up. I will do some more investigating to make sure it still turns on and off as I have it programmed.
    I had tried putting a line of code at the beginning of the program to drive the pin LOW, but the mosfet was actually turning on while the program was downloading to the stamp. As soon as the program finished downloading and it read the code, the mosfet would turn off, but by then it was too late.

    I have run into this condition before of pins floating between high and low unpredictably if not properly pulled high or low. Maybe this time I will remember.
    Thanks again,
    Lloyd
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-29 14:04
    As Leon mentioned, this is a common issue with all sorts of CMOS logic. CMOS gates are voltage sensitive and have very high impedance inputs and any input gate will be very sensitive to ambient voltages like those from adjacent conductors or a finger too close to a conductor attached to the gate. The only way to prevent this other than very careful shielding is to use a pullup or pulldown resistor. 10K is a good compromise between RC time constants and power consumption.
Sign In or Register to comment.