PDA

View Full Version : POWER ON/OFF key in a matrix keyboard 18F46k80



longpole001
- 11th March 2015, 04:22
Hi guys

i am looking to use a 2 x 2 matrix keypad , where 1 of the keys is to be used as a power on /off

i have not played with ultra low sleep mode as yet but think this would be usefull for the power switch use

it is intended that the active row output scan would be low pulses , where the column inputs would have 4k7 pullups.

the column inputs to the pic would be connected to the INTx on the chip , to allow the power switch to trigger the pic from a sleep state

the INts would be setup to use negative trigger state to wake the pic

the question is would this work cos in sleep state , there is no active scan of the keyboard and to generate the negative pulse when the power key is pressed

when in sleep mode , the row pins would be off , but is this low enough to trigger the INT pins to wake up the PIC ,

if not how can this be done


cheers

Sheldon

Art
- 11th March 2015, 14:04
There might be a way it could work, but is that a production 2x2 keypad?
It just sounds like a waste of time and doesn’t save any pins over using four buttons.

Art
- 11th March 2015, 14:35
Just a thought... Doesn’t the sleep timer have an amount of time it sleeps in low power,
then wakes up, then you have to put it to sleep again and keep working that way?
If so, you could turn on the output pin and just check the one button for power on before putting it to sleep each time.
That just means you have to hold the power button to turn it on, which isn’t out of the ordinary.

That’s if an interrupt doesn’t work in the first place.

longpole001
- 12th March 2015, 20:31
Hi Art , hows things on the other side of OZ,

the keyboard will be custom one so can do it any way i like , although it has to include LEDs in the membrane

i need a switch to allow power/ on off and incorporating it into the keypad was the best way to go

I am limited to max of 8 wire connection for the keypad - long story
i am still sorting out the keypad design looks at the moment and trending to a 5 keys including power button , plus 5 leds in the keypad

as such a matrix approach seems the best at the moment

power switch is looking best to be a single button as this can easly control power drectly to regulator enable and the cpu or just the cpu and thus the rest of the pwr cct

this thing is battery powered so like to reduce power to the bare min when not in use ,

but it does have the option to wake up and check messages, advise info every 30min for sec then power down
cheers

Sheldon

longpole001
- 13th March 2015, 07:10
if the pic is in sleep mode and the INT's pins are setup for low edge trigger , then are the INt' pins internal pulled high and have a logic high when the pic is sleeping ?

just thinking if this is the case then then power switch need only have it ground the pin

longpole001
- 13th March 2015, 07:30
7738

thinking this should work ok , was concerned about the sink current of the LEDs in the matrix , but if only 1 colum of led is on at any time then max sink current is 20ma per pin

thinking ratio of 1 key scan to 3 outputs of the led on signals , so that the keys are scaned every 150ms

the power switch was kept seperate input to ground so that is could trigger the Low going interupt for sleep mode wakeup

Art
- 14th March 2015, 14:28
Looks like you can’t go wrong then.
Lovely over here Sheldon :) It’s possibly a hiking day tomorrow.