Can any of you figure this one out? I have a PIC16F628-based circuit usi= ng 2=20 multiplexed switches like this... .__________. | 16F628 | | | | RB0 |---------o-------------| MOSFET 1 gate | | | | RB1 |---------|-------o-----| MOSFET 2 gate | | | | | RA5 | | | '----------' | | | |/ o | | A>--'\/\/\,--| NPN |] Pushbutton N.O. | R1 |\> o | | | | | | | | (D) | | | | | | | `-----------------o--|<|--' | 1N4148 ,--'\/\/\,--' | R2 GNDb Port B is all outputs, and RA5 is an input. The point at (D) is just a d= irect=20 connection for now. R2 is a 10K pull-down resistor. Only one output on = port=20 B will be High at any time, with the rest Low. When either RB0 or RB1 is= =20 high, the input value at RA5 is read to determine the state of the=20 corresponding switch. Well, it works properly. Oddly, I have another circuit, which is identical with respect to this po= rtion=20 of the circuit, but it does NOT work properly. When point A is connected= to=20 +5V, the transistor switches on, and is properly detected, but the pushbu= tton=20 cannot be detected until the transistor is switched off. However, the=20 circuit will function properly with another diode added at point D (bande= d=20 end away from the transistor). In the second circuit, I would think that the emitter serves/acts as a di= ode=20 when the transistor is on, so that another diode at the emitter is not=20 required. I do realize that the proper diode behaviour is achieved in th= e=20 B-E junction of the transistor, but thought that the C-E junction is some= what=20 unidirectional as well. I've re-checked the initialization and usage code, but cannot see any=20 difference in this portion of the circuit. Any idea why this additional=20 diode is required in the second circuit? Thanks, -Neil. --- [This E-mail scanned for viruses] -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.