[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


in a program to make a led blink, when a 1 is written to one...

<< Back to: Embedded Processor and Microcontroller primer and FAQ

Question by Pyke
Submitted on 12/20/2003
Related FAQ: Embedded Processor and Microcontroller primer and FAQ
Rating: Rate this question: Vote
in a program to make a led blink, when a 1 is written to one of the ports of an atmel at89c2051 microcontroller, say p1.0, i am expecting to see the led come on but instead the led is turned off.  When a 0 is written to the port, the led is turned on. The led is connected directly to the port with a resistor in series to the led and Vcc. Thanks


Answer by Wasty
Submitted on 6/15/2004
Rating: Not yet rated Rate this answer: Vote
Hello, Pyke.  Let me start by explaining how digital data works.  If there is a 1 written to a port (for instance your serial port on your pc) there will be a possitive charge (+12v), if the port is set to 0, there will be a negative charge (-12).  So if you plug the LED in, opposite from what you have it set to now, your light will tun on with condition 1 and off with condition 0.
Uh, looks like I'm a few months late.  6/15/2004-12/20/2003 lol

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Embedded Processor and Microcontroller primer and FAQ


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.