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

    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 ...
    _______________________________________________



  2. #2
    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 21:30.

  3. #3
    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 ...
    _______________________________________________



  4. #4
    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.

  5. #5
    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 05:08.

  6. #6
    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

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


    Did you find this post helpful? Yes | No

    Default Edward & Warrior

    Do you really think this is the right place for a conversation like this?
    regards

    Ralph

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



  8. #8
    John C's Avatar
    John C Guest


    Did you find this post helpful? Yes | No

    Question

    Edward is PORTC.2 set to digital using the CMCON Register

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