??? 02/02/12 14:21 Read: times |
#185775 - Design the hardware first. Responding to: ???'s previous message |
The traditional 8051 has a relatively long start-up time compared to other microcontroller families. So an LED or motor that turns on with the power and is not turned off until the software is running is an 'embarrassment'. All the same even a 10ms glitch is unwise on any controller, just not so noticeable.
The solution is simple. An external pull-up or pull-down resistor. You have to ensure your default state when the controller is in RESET. During RESET, the pins are all inputs on a PIC, 8051, ... If you designed active-low, you use a pull-up. Active-high needs a pull-down. Even though a PIC port defaults to 0, it remains an input until you set its DDR. With default active-low, the PIC writes 1 to the port before it sets the DDR for o/p. With default active-high, you write 0 to the port before you make it an o/p. The external 'pull' resistor ensures off until the software is running. The traditional 8051 does not have a DDR. It is therefore wiser to use active-low. All the same an external pull-down can ensure 'off'. You then need a PNP transistor to provide source current. If you have made a design mistake, change to a variant with push-pull output. Then you are in the same position as your PIC colleague. David. |