pause puts me in sleep mode


Results 1 to 21 of 21

Threaded View

  1. #16
    Warrier's Avatar
    Warrier Guest


    Did you find this post helpful? Yes | No

    Default

    Edward:

    Don't tie yourself in knots with your code!

    The reason for a good schematic is to see where and what causes such a heavy drain of current in your circuit to pull Vdd down. It is not to see how well you can desolder 1000+ connections as you think.

    An NPN transistor needs a little more than 600mV on its base MORE POSITIVE than voltage on its emitter. A PNP needs 600mV LESS on its base than voltage on its emitter. A transistor unlike an FET is a current controlled device. The collector current is the product of base current and the current gain of the transistor. Transistors are made with different gain which is also a function of the frequency at which it operates. That's 101 on transistors. If you need more tutorial on transistors this is not the forum for it!

    So if you need to turn on a NPN transistor you need to have two conditions met - voltage at base is higher than 600mv trelative to emitter voltage (=0)and provide sufficient base current to operate the load connected at the collector.

    In your case, the PIC supplies 5volt out - you are trying to drive a solenoid. If your solenoid needs some current through its coil to turn it on - what is your solenoid spec? If it needs more current than what your regulator can supply then the 5v regulator will shut down and the solenoid will not turn on.

    Solenoid also requires a minimum time to turn on. If your solenoid turn on time is more than 200msec it will just click but will not come on.

    Now to your latest code - you turn on portc.2 and then trisc the pin to input! That will not turn off the solenoid unless transistor A is a digital type and connects the base to emitter through a resistor so that when portc.2 becomes input the base voltage drops to zero. Leaving the base open with collector driving an inductive load is a good way to destroy the part.

    You must have changed the 5volt regulator and the solenoid from your original unit - Even if you short circuit all output pins of portc the PIC will not draw enough current (that's <200mA) to pull Vdd to 3.5volts. Your post says pause puts you to sleep - do you realize that sleep mode keeps the PIC at its lowest power consumption!!!!!!!

    Like Ralph says, post your schematic correctly - if you can't tell a diode from a transistor then you have a long way to travel, my friend.

    -warrier
    Last edited by Warrier; - 9th May 2005 at 01:51.

Similar Threads

  1. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 16:23
  2. Replies: 11
    Last Post: - 12th July 2008, 03:36
  3. Pic to LanC
    By grounded in forum Off Topic
    Replies: 9
    Last Post: - 24th June 2008, 01:12
  4. Fade out LEDs question
    By Sam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd June 2008, 11:50
  5. Help Quick Need to make code smaller
    By Programmednew in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th January 2005, 04:46

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts