i mean that i connect a port to a push button where is the other end is connected to a pull up resistor with 5V. when i push the button, it will on. but after i release, it should b off but why my pic on the port still is 'high' ? got what coding that can change the input that "high" to "low"?
The diagram says a lot.
The end of the switches that is connected to the resistors should go to ground and the resistors should go to the pin ports.
Port (pin) Logic is HIGH with switch idle, LOW when switch is pushed. This is for the first picture, when (unlike what you said) the resistors are tied to ground, In the second picture I can't see where they are tied.Code:PIN<--------->SWITCH<---------->GROUND ^ | | | L----------->RESISTOR<-------->Vdd(power)
Anyway I NOW understand what you are saying. What's going on is you push the button for a high, the port goes high, but when you release the switch, the port still reads high. That's called a "FLOATING INPUT" and a poor design. Use the logic I show above. It's a good way to keep the pins from floating (not high, not low, but read as high).
Last edited by JD123; - 21st March 2008 at 21:16.
y the data lines of my lcd from pic doesnt light up? is it due to the programming problem ? or due to the pic ports? because i connect the data lines to port B.4-B.7 of pic.
I can't make out that part as the pictures don't show those connections in full. Anyway, use pull-up resistors on the data pins going to the LCD or the weak pull-up port option if it's available on those pins. Past that, it maybe a code issue.
Post a clear picture of the pins to LCD connections and post some code.
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
Bookmarks