Menu

pic12f683 not entering low power mode (sleep)

Help
Chris
2011-05-18
2013-05-30
  • Chris

    Chris - 2011-05-18

    Hello, im trying to get my pic to consume as little power as possible. My application is to use the chip as a security alarm in my electric scooter (which i have accomplished) but running on AA batterys its comsuming about 40ma of power, so it lasts about 40 hours before the batterys are flat dead. Ive read in the datasheet that the pic should be able to enter sleep to consume very little power but no matter which way i tell it to sleep (asm sleep, sleep, SLEEP) it still consumes about 40ma. any help would be greatly appreciated. im using great cow graphical basic and manually entering the asm sleep command inside a loop.

     
  • Chris

    Chris - 2011-05-18

    a correction to my problem. the chip is going into a sleep mode. I know this because i setup a led blinking loop, where if i told it if i brought an input high, to go into asm sleep. so when i brought the pin high, the led remained lit, and stayed that way even after i brought the pin low again (with WDT off). so i know its going into sleep mode, but it contines to use exactly 35milliamps of power no matter what i do. i thought that if i put the chip in sleep mode it was supposed to use very little power and 35ma in my opinion isnt very little power. ive heard of people using button cells to power their pics for long periods of time. with this much power consumption a button cell would last less then a day. i have tryed bringing all pins low, all pins high, everything but it always uses the same amount of power. any ideas?

     
  • gcha44

    gcha44 - 2011-05-18

    Hi ,
    35mA is a very high intensity for a 12F683 . Consumption is depending of Oscillator ( it's more important at 20Mhz ) . In sleep mode , consumption is about 0.30µA at 25°C with all peripherals disabled ( see datasheet) !!
    Are you sure it's only the microprocessor consumption ? If you measure general amperage , you can also measure regulator consumption ? Is it the case ?
    Regards

     
  • Chris

    Chris - 2011-05-18

    ok, let me go into a little more detail. im using the internal occilator at 1mhz, i have the 5volt output of my voltage regulator going through my multimeter and into the pic. the only thing im driving is an led to let me know its going into sleep. power consumption with the led on is 40ma, and with the led off and supposidly in sleep mode is 35ma. the led has a 1kohm resistor on it. here is my code in case that helps. maybe im missing something in there because using 1600ma AA rechargeable batterys (4 of them to get 4.8 volts) they lasted less then 2 days on a full charge. im somewhat new to pic micros but am learning fast, obviously i have alot to learn.

    ;Chip Settings
    #chip 12F683,4
    #config CPD=ON, MCLRE=OFF, WDT=OFF, OSC=INTRC_OSC_NOCLKOUT

    Do Forever
    Set GPIO.5 On
    If GPIO.0 = 0 Then
    Set GPIO.5 Off
    asm sleep
    End If
    Loop

     
  • Chris

    Chris - 2011-05-18

    just to clarify, i just tested the current consumption with using only AA batterys, and it was almost 50ma with the led on and 45ma with the led off and in sleep mode, no regulator, nothing hooked up to any pins except the led and its current limiting resistor, i even tested with all the pins except the led pin at vss and at vdd and same result. how do i turn off the periferals. i looked in the datasheet and saw ways of turning off the comparitors, and read online about having to turn off the voltage comparitor, but ive tryed adding just about every bit of code i saw and none of them reduced the power consumption

     
  • Nobody/Anonymous

    45ma is WAY more (by a factor of about 10x) than the PIC itself would draw, even when not in sleep mode. Are you sure there's not something connected to another output port that might be drawing current?

    Joe

     
  • Chris

    Chris - 2011-05-18

    well i just connected the pic to my battery pack of 4 x 1.2volt AA's with nothing else connected to any port, just the + of the batterys to the + of the pic, and the - of the battery connected to the - of the pic, my multimeter is still telling me 45ma. mind you this isnt a digital multimeter, just an analoge one, but to see if my multimeter was the problem i connected it to an led with a 1k resistor, and it tells me that draws 5ma. so im inclined to believe my multimeter is telling me the truth, and on top of that like i mentioned my batterys are 1600mah and they were dead within 40 hours, so if my math is right it is drawing about 45ma, even without anything connected to it, all pins floating, running the program that i previous mentioned. by the way thanks everyone for such quick responces, though they are very worrysome, could i possibly have a bad pic? or am i doing something else entirely wrong?

     
  • Nobody/Anonymous

    My pic is exactly how my pic is wired, nothing is attached to it that is not in this picture.

     
  • Chris

    Chris - 2011-05-18

    my appologizes for so many posts but that last post with the picture was from me, i hooked it up to 2AA s instead of 4, and its now drawing 23ma

     
  • Chris

    Chris - 2011-05-18

    could this problem possibly have anything to do with the fact that i was originally trying to use icprog to program this 12f683 and telling it that it was a 12f675? i was originally having serious issues with my jdm programmer and winpic800. it wasnt detecting my programmer at all (originally because i use a laptop that puts out around 5 volts and wasnt enough to set the pic into 13 volt program mode, which i made some modifications to my programmer with a couple voltage regulators and an external supply and programming it goes well using the orignal winpic, not winpic 800) i always do a bulk erase before programming so i dont think that should have done permanant damge causing the pic to draw too much current in normal mode and the same amount of current in sleep mode but i am now to this and impatient newbes tend to lead to bad chips. well at hopefully my mistakes will at least help someone else from making my mistakes. if anyone wants the schematic to turn a low voltage serial port powered programmer into an externally powered high voltage programmer let me know because the programmer works excellent, all my programs execute just as intended, aside from a high current draw resulting in premature battery drain

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.