pause puts me in sleep mode


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Im not sure if the (B) PNP transistor is in fact a PNP, it could be some weird 3 pin device.
    I would assume (B) is a Diode in a three pin package.
    (Cathode should be connected to the red wire of the solenoid, anode to the black wire.
    Is there any SMD code printed on it?
    also its weird how there is a 5+ going into the solenoids RED supply and 4.2+ going into the solenoid on the BLACK supply.
    with the NPNs (A) base low there is a voltage drop of about 0.8V accross the solenoid, this means there must be something else connected to the NPNs collector that is drawing current.
    when i drive the npn base high (portc.2) the solenoid gets "stuck on" the 4.4 that was present on the BLACK is now 0vdc. and the RED is at 3.5 vdc, meaning the vdd is at 3.5.
    looks like the solenoid draws more power than the Vreg can deliver, that causes the voltage drop at the Vreg's output.
    even if i drive the portc.2 LOW the transistor stays on cause the board has "crashed".
    If the transistor stays on, the base isn't low !
    now i cant read the voltage at the transistor base because when i put the (my multimeter) black probe on the battery ground and the red probe
    on the NPN base it drives the base Low making te solenoid turn off, and putting 5+ back on the VDD, thereby reseting the pic to the top of the program. if i disconnect the solenoid, i get all the expected reading at the expected times, e.g. portc.2 will actully out a 5+ vdc when i tell it to and 0vdc when i tell it too.
    Questions:
    1. what is the resistance of the solenoid?
    2. what kind of multimeter are you using and what is it's input resistance in the voltage range you have selected?


    lastly, im telling you there is not a harware problem, power supply problem, solenoid problem. i have tested all my parts on another board, that still has the old code, and they work.
    are you really sure the schematic matches the board?
    Last edited by NavMicroSystems; - 7th May 2005 at 16:17.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  2. #2
    EDWARD's Avatar
    EDWARD Guest


    Did you find this post helpful? Yes | No

    Default pause command

    yes its a led and a resistor series.

    the transistor b is a digital type cause i do get 5v when i disconnect the solenoid.

    I cant stress enough how harware is not the issue here. These boards are all surface mount, and i cant go cutting 1000+ traces guys. I didnt design 'em, or have anything to do with the manufaturing process. This device can be coded proprerly to work, i know this. i dont mind if the code idnt prtty, or has long boot sequncces(i have an lcd issue as well). im putting up some more pics in that yahoo album. ill double check that schematic for errors.

    great info guys thanxs.

  3. #3
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by EDWARD
    ...I cant stress enough how harware is not the issue here.
    ...This device can be coded proprerly to work, i know this.
    EWDWARD,
    of course there will be a way to get it to work, but it will be difficult without having a schematic.

    A simple example I have seen in the past was a standard TTL I/O pin on the PIC being used as open Drain.

    If you would assume it was a standard output, you would never get it to work.
    You would have to make that pin an input if not driven low. (Some kind of "Software open-Drain")

    With the unusual parts of your hardwares design we have seen so far I wouldn't be surprised if there was more of that kind.

    To ensure the product works reliably with your new code you will have to do some reverse engineering and draw a full schematic of the board.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  4. #4
    EDWARD's Avatar
    EDWARD Guest


    Did you find this post helpful? Yes | No

    Default

    yes, it is going to be difficult, thats why im in here

    i have decided to make a schemtic of the whole board. ill might even desolder one of my boards so i can see the layout better.

    what are the basic priciples on uing an input control a trans?

    It sounds like your saying i need portc.2 as an input throughout the whole process.

    i can trisc more then once, right?

    i already tried a code like this with no success: 'some things are wrong for simplicity.

    '-----------------------------------------
    main:

    trisc=%11111011 'portc.2 as output

    if portb.0 = 1 then 'if i press a button
    gosub fire
    endif

    goto main

    fire:
    portc.2 = 1 'make transistor active
    pause 500
    trisc=%11111111 'portc.2 as input
    pause 500
    RETURN
    '--------------------------------------------
    Last edited by EDWARD; - 8th May 2005 at 20:30.

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    EDWARD,

    The "Open-Drain" Scenario was just meant to be an example of a Hardware design that would give you a hard time in Software Development without knowing the schematic.

    Desoldering one of the boards and drawing a full schematic is a good idea.
    Try to document all type codes of the components before they are all wiped off.

    BTW
    Here is yet another example for your "Fire" Subroutine
    Code:
    Fire:
    HIGH PortC.2  ' make transistor active
    PAUSE 500
    INPUT PortC.2 ' PortC.1 as input
    PAUSE 500
    RETURN
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  6. #6
    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 00:51.

  7. #7
    EDWARD's Avatar
    EDWARD Guest


    Did you find this post helpful? Yes | No

    Default warrior

    did you read this forum from start to finish?

    i know how a transistor works.

    what are you talking about seeing how good i can desolder?

    there are leads that run under componets, ill need to only desolder 1 board dude.


    i have 1000+ of these boards,not connections. so i can get the component data either before or afterwards or any time in between.

    i know the code wasnt going to work, it was to try and get an understanding on what NAV ment in his previous post.

    yeah i changed a surface mount pcb......not!

    oh yeah, could you be anymore condensending??

    dont bother replaying warrior cause i dont need help from a jerk. ive been very polite so far and i think i deserve to be talked to better then that.

    and for the last time NO F'ING HARDWARE CHANGES!!!

    and lets say i dont knw what a diode is or a transitor is, does that give you the right to be a jerk?

    you are an idiot warrier. please dont fill up this forum with your trash.

    oh yeah, i have a ! button too.
    Last edited by EDWARD; - 9th May 2005 at 04:08.

  8. #8
    Warrier's Avatar
    Warrier Guest


    Did you find this post helpful? Yes | No

    Default

    Edward:

    The first thing you learn is to keep your language clean! This is not a tabloid...

    It looks as though your willingness to learn or understand technical forum is as good as your soapy language...

    You don't run this show and if you can't take some critique then keep digging into your SMD stuff - no one is stopping you.

    As for knowing how things work - may be you could take some elementary courses in the English language before you try these forums which are for people with a little more savvy.

    Good luck

    -warrier

Similar Threads

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