EvilGenius
Member
Hello
I am working on a PIC based board and having logic issues reading switches.
uController: PIC16F628A
Language:Assembly
I am utilizing all the inputs/outputs of this chip.
PortA: 1, 2, 3 are setup as inputs
SWS: is a 3 position SW, displayed here as 3 separate switches. Only one switch can be ON at one time, Common anode.
Function: If Sw is in position 1, LED1 is turned on, and PortA,1 is set high. When PIC reads the logic of all 3 SW's, sees this as logic "1" on PortA,1 and does something. Same true for other SW positions..... PortA,2 and 3...
When SW is closed, PIC sees logic 1. No problem. When SW is open, PIC still sees LED Diode voltage. (not logic "0")
This is enough voltage to keep port status high and fail logic zero test. Any suggestions to overcome this issue?
Thanks in advance for your suggestions.
I am working on a PIC based board and having logic issues reading switches.
uController: PIC16F628A
Language:Assembly
I am utilizing all the inputs/outputs of this chip.
PortA: 1, 2, 3 are setup as inputs
SWS: is a 3 position SW, displayed here as 3 separate switches. Only one switch can be ON at one time, Common anode.
Function: If Sw is in position 1, LED1 is turned on, and PortA,1 is set high. When PIC reads the logic of all 3 SW's, sees this as logic "1" on PortA,1 and does something. Same true for other SW positions..... PortA,2 and 3...
When SW is closed, PIC sees logic 1. No problem. When SW is open, PIC still sees LED Diode voltage. (not logic "0")
This is enough voltage to keep port status high and fail logic zero test. Any suggestions to overcome this issue?
Thanks in advance for your suggestions.