Switch PIC16F877 ON/OFF


Closed Thread
Results 1 to 8 of 8
  1. #1

    Arrow Switch PIC16F877 ON/OFF

    Good Day

    Please see Attached Drawing.

    I have a MAX1672 Step Up / Down Converter to Regulate my Voltage for my circuit as well as to switch it ON and OFF.

    Attached to my PIC16F877 is a Membrane Keypad with an ON button to switch my circuit ON.
    This is working smoothly as the MAX1672 Put the circuit ON if I put the PIC Pin (Bottom Left) Low and OFF if it is High, so I have put a Pull Up Resistor on the PIC Pin so that it is by Default High (OFF).

    If I press the ON Button on my Keypad it Pulls the Pin to Ground, switch the circuit on and then the first Line of Code I put that PIN (Bottom Left) LOW to keep the circuit ON.

    This is working without a problem, but when I tried to program my keypad I get the following problem.
    The top 4 Input Pins I put high and the Bottom Output Pins low, and then check for a LOW on the top 4 to find out which key was pressed.
    But Because the Pin in the left bottom corner is LOW to keep the circuit on, it Pulls the one line of the keypad also to LOW, so that Line is always low.

    How could I fix this Problem?
    Attached Images Attached Images  

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Use signal Diode such as 1N4148 or similar.
    Attached Images Attached Images  

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thank you Melanie, I will try that!!!

  4. #4


    Did you find this post helpful? Yes | No

    Question

    Hi Melanie,

    I'm not that good with electronics and have asked someone else if it would work if I use a signal Diode such as 1N4148?
    This is what he Said:
    __________________________________________
    No it wouldn't work, because the MAX1672 digital inputs need 0.4V VIL(max), and your signal diode would make the pin over 0.8V.
    Even if you use a Schottly diode like the panasonic MA793 or a germanium diode (0.2V to 0.3V) this would still make the VIL too high, and would leave a very narrow noise margin. At cold temperatures the circuit might not turn ON.

    The (2) 2K resistors make a VIL of less than 70mV, guaranteeing the turn ON. And the PIC has no sweat driving the resistors loads.
    __________________________________________

    Is he correct with his comments?

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You've shot yourself in the foot with the way you've designed your circuit. Just try it with a silicon diode, and if it's not reliable, use a germanium one. I've not looked at the product Datasheets but offered a potential solution on your circuit, it's up to you to go impliment and play. If you want to experiment at extremes, you've got a fridge, you've got an oven. Go test. Geeze, there's no guarantees in this world apart from death and taxes.

  6. #6


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi Melanie

    Thank you for your reply!

    Quote Originally Posted by Melanie
    You've shot yourself in the foot with the way you've designed your circuit.
    What is a better way to design it, I can still make changes to my design?

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Probably i don't understand the whole thing as it's suppose but here's what i suggest.

    remove the diode and blah blah. Use only your keyboard.

    You just want to monitor the ON switch right???

    This switch is attach between RB.3 and RB.4 right???

    NOW what about...
    Code:
    ' define and blah blah 
    '
    '
    HIGH MAXPIN
    LOW PORTB.3
    OPTION_REG.7=0 'enable internal Pull-UP
    While PORTB.4 : WEND ' wait untill ON button is pressed
    LOW MAXPIN
    This should work
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi Steve,

    I'm not sure if I understand you correctly.

    The MAXPIN is HIGH by Default, which keep the Power to the PIC Off.
    If I press the ON Button, it pulls the MAXPIN to LOW and the circuit will switch on.
    The First Line of your Code, "HIGH MAXPIN" Would then switch the Power to the PIC Off?

Similar Threads

  1. Switch on/off every sine pulse
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 27th July 2009, 20:45
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. 'Soft' On/Off Power Switch
    By Art in forum General
    Replies: 19
    Last Post: - 14th November 2008, 01:54
  4. Swicth PIC ON/OFF with Membrane Keypad
    By koossa in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th August 2005, 13:28
  5. Switch Polling vs Interrupts
    By eric blair in forum General
    Replies: 1
    Last Post: - 17th October 2003, 09:38

Members who have read this thread : 1

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