hm_fa_da
Full Member level 5
Hi all ,
in my project :
there is a transistor series whit MCU power supply ,it's base is controlled by both MCU and a uSwich , when i press uSwich , it turnes on and after turning on , MCU keeps transistor active( writting 1 to transistor base ) , and when the circuit shold turn off , MCU deactive the transistor ,so it turns off the power itself.
there was a problem this case , if i keep the uSwich still pressed , then MCU can not take the circuit off , so
i used a 10uF capacitor series with uSwich , meaning when i keep the SW , it first turns on circuit , and during this time the Capacitor is charged ,MCU keeps power on and capacitor is charged completely, so it is like SW is not pressed ,
and MCU can turn off the circuit ,
and again if i want to turn on the circuit , i should depress the SW ( SW is NO/NC type ) , this allows Capacitor being discharged ( thorugh a low resistor ) so pressing SW again would activate the power transistor and so on ....
the problem is this :
when MCU turns the transistor off by writting 0 to it's output ,the power supply is disconnected and voltage on VCC of MCU decreases to 0V , my MCU is AVR(ATmega162 - BOD Enabled on 4.0V ) , 2.7V-5.5 V operating range ,
when voltage goes less than 2.7V (slowly) , CPU will not function well and MIGHT changes the output pin ( which connected to transistor ) high again , so it reActivate power transistor on and does not allow the circuit get off .
this problems occures morly when voltage is decreasing slowly , and in my circuit is like that and there is no way to change this ( because of the circuit design ) , like there is a big capacitor between VCC and GND .
( it does not occure always , just sometimes )
now i want to know what i can do in MCU software for a safe or at least BETTER turning off ,like going to power down mode or any other way if has a good effect .
Thanks ,
Best Regards.
in my project :
there is a transistor series whit MCU power supply ,it's base is controlled by both MCU and a uSwich , when i press uSwich , it turnes on and after turning on , MCU keeps transistor active( writting 1 to transistor base ) , and when the circuit shold turn off , MCU deactive the transistor ,so it turns off the power itself.
there was a problem this case , if i keep the uSwich still pressed , then MCU can not take the circuit off , so
i used a 10uF capacitor series with uSwich , meaning when i keep the SW , it first turns on circuit , and during this time the Capacitor is charged ,MCU keeps power on and capacitor is charged completely, so it is like SW is not pressed ,
and MCU can turn off the circuit ,
and again if i want to turn on the circuit , i should depress the SW ( SW is NO/NC type ) , this allows Capacitor being discharged ( thorugh a low resistor ) so pressing SW again would activate the power transistor and so on ....
the problem is this :
when MCU turns the transistor off by writting 0 to it's output ,the power supply is disconnected and voltage on VCC of MCU decreases to 0V , my MCU is AVR(ATmega162 - BOD Enabled on 4.0V ) , 2.7V-5.5 V operating range ,
when voltage goes less than 2.7V (slowly) , CPU will not function well and MIGHT changes the output pin ( which connected to transistor ) high again , so it reActivate power transistor on and does not allow the circuit get off .
this problems occures morly when voltage is decreasing slowly , and in my circuit is like that and there is no way to change this ( because of the circuit design ) , like there is a big capacitor between VCC and GND .
( it does not occure always , just sometimes )
now i want to know what i can do in MCU software for a safe or at least BETTER turning off ,like going to power down mode or any other way if has a good effect .
Thanks ,
Best Regards.