PDA

View Full Version : Switch PIC16F877 ON/OFF



koossa
- 26th August 2005, 15:36
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?

Melanie
- 26th August 2005, 15:51
Use signal Diode such as 1N4148 or similar.

koossa
- 26th August 2005, 21:07
Thank you Melanie, I will try that!!!

koossa
- 27th August 2005, 10:31
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?

Melanie
- 27th August 2005, 11:28
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.

koossa
- 27th August 2005, 12:12
Hi Melanie

Thank you for your reply!


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?

mister_e
- 27th August 2005, 12:25
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...


' 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

koossa
- 27th August 2005, 12:34
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?