??? 01/11/07 07:55 Read: times |
#130620 - Basics Responding to: ???'s previous message |
Hazman Anuar said:
i want to light up an LED at port0, what should i do, Joseph has explained to you how an open-drain (or open-collector) output works - it is effectively a switch to ground: When the transistor is ON, the switch is "closed", ie, the ouput is connected to ground; When the transistor if OFF, the switch is "open", ie, the ouput is disconnected from ground. A pull-up resistor will "pull" the output "up" to Vcc when the transistor OFF; When the transistor is ON, it "pulls" the output "down" to ground. In the 8051, you turn the P0 transistor OFF by writing a '0' to the Port bit; In the 8051, you turn the P0 transistor ON by writing a '1' to the Port bit. Hazman Anuar said:
i'm new to the 8051 controller... In fact, your question suggests that you are not only new to the 8051 in particular, but completely new to any form of electronics - is that right? You really need to get a book on basic electronics - it is not practical to teach this from first principles by answering one question at a time in a forum like this! You might like to take a look at the Beginner Tutorials tutorials here: http://www.iguanalabs.com/maintut.htm Start with Basic Concepts: http://www.iguanalabs.com/basicdef.htm |