HankMcSpank
- 16th May 2012, 23:24
Forgive the esoteric subject but it's hard to articulate what I'm trying to resolve.
I have a MOSFET under PIC control.....a mosfet gate is normally low but when a tactile switch is pressed, a PIC interrupt happens & a PIC output pin goes high & switches the MOSFET on - no worries thus far.
*but* occasionally, depending on the deployment (& I won't know in advance so it'll be down to the end user to establish) I will need the above scenario to reversed & this will then be the default .....therefore the MOSFET gate will normally be high & when a tactile switch is pressed an interrupt is triggered and a PIC output pin goes low & switches the MOSFET off.
So what I'm thinking here is when the user deploys & it doesn't want the default...that he can change it.
But what I don't want is a massive long program to cater for both scenarios...I'm thinking that if the user holds a switch prior to powering up, then the 'default' can be selected to the non default (in other words, a toggle).
You following this at the back?
in summary, this is what I'm trying to achieve....
factory_default...
mosfet_gate = low
when switched pressed mosfet_gate = high
user_selectable_new_default....
mosfet_gate = high
when switched pressed mosfet_gate = low
How do I tackle this in an efficient way?
I have a MOSFET under PIC control.....a mosfet gate is normally low but when a tactile switch is pressed, a PIC interrupt happens & a PIC output pin goes high & switches the MOSFET on - no worries thus far.
*but* occasionally, depending on the deployment (& I won't know in advance so it'll be down to the end user to establish) I will need the above scenario to reversed & this will then be the default .....therefore the MOSFET gate will normally be high & when a tactile switch is pressed an interrupt is triggered and a PIC output pin goes low & switches the MOSFET off.
So what I'm thinking here is when the user deploys & it doesn't want the default...that he can change it.
But what I don't want is a massive long program to cater for both scenarios...I'm thinking that if the user holds a switch prior to powering up, then the 'default' can be selected to the non default (in other words, a toggle).
You following this at the back?
in summary, this is what I'm trying to achieve....
factory_default...
mosfet_gate = low
when switched pressed mosfet_gate = high
user_selectable_new_default....
mosfet_gate = high
when switched pressed mosfet_gate = low
How do I tackle this in an efficient way?