At 09:39 PM 29/04/98 -0400, you wrote: >Hello everyone, > > In a design using the PIC16F84 to turn on a switching transistor for >8 seconds and turn it off afterwards, I encounter the following problem. > >a) the transistor switches on at the appropriate time as determined by the >program, but afterwards does not switch off even though the timing period >has ended. > >The DC power supply for the circuit consists of a 16 volt ac adapter with >full-wave bridge rectifier, an LM317 adjustable regulator to give 14 volts >to recharge a battery, and a 5 volt regulator to power the pic. > >I am using an RC oscillator and the clock frequency is approx. 2.8 MHz. > >The RB4 pin is used to drive the base of a PN2222 transistor through a 2.2k >ohm resistor. The emitter is grounded and the collector is connected through >a 220 ohm resistor. Output is taken from the collector. > >This transistor is used to turn off the LM317 regulator for 8 seconds so as >to load the battery to test its voltage across a voltage divider network. >This voltage is then input to the pic for sensing. > > >Both the PIC and the transistor switch operate as they should , when >connected independently. > >However, the following is observed when a logic probe is connected in circuit. >The transistor remains on all the time once it is switched on by the pic >even though you can hear a pulse at the end of the timing period on RB4. > >I have tried using a shunting capacitor on RB4 but to no avail. > >Has anyone got any suggestions to help me solve this problem. > >Thanks for your usual cooperation. > > > > Rawle > > You give no indication as to if the line is actualy going low at the end of the period (I assume that low is off). So is this happening? Note that the PIC does have some internal pull ups that can be enabled on this port (For inputs only). If you dissconnect the transistor (Remove the 2k2) does the port pin go high and low as expected? Exactly how is the transistor used to switch off the regulator? (Just for interest only!) Dennis