I'm trying to use one I/O for both input and output (RA1 on a 16C84). Software - Every [so often] the pin is changed to an output and set high to drive an LED for about [a while]....then turned off and changed back to an input. Between the LED blinks I poll the input to check whether it's HI. To debounce, the input must be HI once and again 20msec later. I've got the weak pull-ups disabled.
Hardware - The pin has a 470 ohm resistor and (Smurf-) blue LED to ground. Also a pushbutton switch and 10k resistor to V+.
What should happen:
What does happen:
Why:
I use the inverse (LED to vcc, push button low) of your circuit (with the extra resistor) on my graphic LCD checker:- http://ourworld.compuserve.com/homepages/steve_lawther/t6963tst.gif with no problems.
PIC 16F84A elapsed time counter on 4, 7 segment LED's
Rotate some bits without affecting others
Fashing LED program for 16f877
Driving multiple bicolor LEDs in a matrix from and embedded controller
Using lookup tables to convert numbers to seven segment LED display patterns
Driving 8 or 9 7 segment displays with 8 or 9 io pins (and no extra circuitry)
From the CHEAPIC tutorial:
See also:
PICList post "How to matrix bicolor LEDs?"
| file: /techref/io/led/pic.htm, 4KB, , updated: 2006/10/19 09:29, local time: 2008/11/21 13:56,
owner: pr-ooo-13G,
38.103.63.57:LOG IN
|
| ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://www.massmind.org/techref/io/led/pic.htm"> Interfacing LEDs to PIC microcontrolers</A> |
| Did you find what you needed? |
Welcome to massmind.org! |
|
.