Just saw this. Use one of the timers with a low frequency crtstal to count time in sleep mode.
-------- Original message --------
From: George Alvarez mightycpa@users.sf.net
Date: 01/10/2018 8:02 PM (GMT-05:00)
To: "[gcbasic:discussion]" 579125@discussion.gcbasic.p.re.sf.net
Subject: [gcbasic:discussion] RE: [gcbasic:discussion] RE: [gcbasic:discussion] Coin powered projects
Hi Joe,
Yes, I have the sleep thing coded already, and it shuts everything down according to the way the data sheet says to do it. Haven't tested it, but I used the same methods I found on the internet that bring power consumption down to micro amp values. I can wake it up too, using interrupts. So that's done, and all I really need to do is count loop cycles to and figure out the loops to time relationship.
Thanks for the info on how to measure the current. I have at least three multimeters, one measures AC current (like home wiring), so for all I know, I can measure tonight.
As I'm reminded again and again, I can be really stupid sometimes. I went to check on the status of my project, and the truth of the matter hit me, right betweeen the eyes. You know the "Standard" and the "Deluxe" model? Well, I have both displays running at the same time. ALL of my testing has been with both displays running at the same time. So in terms of current consumption, it is nearly double what I calculated, seeing as how the LCD is the long pole in the tent.
Also, interestingly, the smaller LCD dimmed out first. The "Deluxe" one, with more pixels, is still alive. Go figure! I have to follow up and get the data sheet for that smaller LCD module. I found a data sheet for an EXTREMELY similar competing product (might be exactly the same) and at 3.3V, it consumes 10mA when fully lit. On average, I'd estimate that I have half the pixels lit at any given time. Sometimes, maybe 25%, rarely more than half. So if that's 5 + 5 from the mcu + 12 from the big LCD, then that's 22, which agrees with how fast I've been chewing up batteries so far.
I also need to disconnect, and try the button batteries again, one LCD at a time. Also, don't know if I've said this here already, but I read somewhere that @11mA consumption, these coin cells have dramatic voltage drop.
I guess a visit to digikey is in order.
Hi Joe, I meant count cycles while the unit is active, so that I know when to put it to sleep... after so long, whatever that is. Once it goes to sleep, it can stay like that for as long as it remains unused. the button click will wake it up.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You’re not suggesting counting cycles through the main loop, are you? That can be very variable depending on what else the processor is doing while it’s awake. Personally, I’d do that in the background with an internal hardware timer that generates an interrupt telling you to go to sleep.
From: George Alvarez
Sent: Thursday, January 11, 2018 9:24 AM
To: [gcbasic:discussion]
Subject: [gcbasic:discussion] RE: [gcbasic:discussion] RE: [gcbasic:discussion] RE: [gcbasic:discussion] Coin powered projects
Hi Joe, I meant count cycles while the unit is active, so that I know when to put it to sleep... after so long, whatever that is. Once it goes to sleep, it can stay like that for as long as it remains unused. the button click will wake it up.
I am, actually. It doesn't do much of anything unless a button is being pushed, or it is writing to the LCD. Writing to the LCD takes less than half a second. I don't measure anything, I don't input anything, I don't monitor anything, I don't drive anything. I just loop around and around until I catch an interrupt, and after that, I count how many counts the button is down to figure out if I have a click, a double click, a short hold, a long hold or a really long hold. Then I change the LCD accordingly and start looping again. Every time I start looping, I reset the counter to zero and start over. The only reason to count is to find a point in time where I decide it's been on long enough, then I put it to sleep. Doesn't matter what the display shows, although now that I think about it, I'd probably do a shorter time-to-sleep if I'm resting at the menu, longer if I've got the key displayed.
Now what do you think? Still don't like it or livable? Trying to keep it simple.
Just saw this. Use one of the timers with a low frequency crtstal to count time in sleep mode.
-------- Original message --------
From: George Alvarez mightycpa@users.sf.net
Date: 01/10/2018 8:02 PM (GMT-05:00)
To: "[gcbasic:discussion]" 579125@discussion.gcbasic.p.re.sf.net
Subject: [gcbasic:discussion] RE: [gcbasic:discussion] RE: [gcbasic:discussion] Coin powered projects
Hi Joe,
Yes, I have the sleep thing coded already, and it shuts everything down according to the way the data sheet says to do it. Haven't tested it, but I used the same methods I found on the internet that bring power consumption down to micro amp values. I can wake it up too, using interrupts. So that's done, and all I really need to do is count loop cycles to and figure out the loops to time relationship.
Thanks for the info on how to measure the current. I have at least three multimeters, one measures AC current (like home wiring), so for all I know, I can measure tonight.
As I'm reminded again and again, I can be really stupid sometimes. I went to check on the status of my project, and the truth of the matter hit me, right betweeen the eyes. You know the "Standard" and the "Deluxe" model? Well, I have both displays running at the same time. ALL of my testing has been with both displays running at the same time. So in terms of current consumption, it is nearly double what I calculated, seeing as how the LCD is the long pole in the tent.
Also, interestingly, the smaller LCD dimmed out first. The "Deluxe" one, with more pixels, is still alive. Go figure! I have to follow up and get the data sheet for that smaller LCD module. I found a data sheet for an EXTREMELY similar competing product (might be exactly the same) and at 3.3V, it consumes 10mA when fully lit. On average, I'd estimate that I have half the pixels lit at any given time. Sometimes, maybe 25%, rarely more than half. So if that's 5 + 5 from the mcu + 12 from the big LCD, then that's 22, which agrees with how fast I've been chewing up batteries so far.
I also need to disconnect, and try the button batteries again, one LCD at a time. Also, don't know if I've said this here already, but I read somewhere that @11mA consumption, these coin cells have dramatic voltage drop.
I guess a visit to digikey is in order.
[RE: [gcbasic:discussion] RE: [gcbasic:discussion] Coin powered
projects](https://sourceforge.net/p/gcbasic/discussion/579125/thread/edea7bc1/?limit=25#25c6)
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gcbasic/discussion/579125/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Hi Joe, I meant count cycles while the unit is active, so that I know when to put it to sleep... after so long, whatever that is. Once it goes to sleep, it can stay like that for as long as it remains unused. the button click will wake it up.
You’re not suggesting counting cycles through the main loop, are you? That can be very variable depending on what else the processor is doing while it’s awake. Personally, I’d do that in the background with an internal hardware timer that generates an interrupt telling you to go to sleep.
From: George Alvarez
Sent: Thursday, January 11, 2018 9:24 AM
To: [gcbasic:discussion]
Subject: [gcbasic:discussion] RE: [gcbasic:discussion] RE: [gcbasic:discussion] RE: [gcbasic:discussion] Coin powered projects
Hi Joe, I meant count cycles while the unit is active, so that I know when to put it to sleep... after so long, whatever that is. Once it goes to sleep, it can stay like that for as long as it remains unused. the button click will wake it up.
[RE: [gcbasic:discussion] RE: [gcbasic:discussion] RE:
[gcbasic:discussion] Coin powered projects](https://sourceforge.net/p/gcbasic/discussion/579125/thread/552698af/?limit=25#8712)
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gcbasic/discussion/579125/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
I am, actually. It doesn't do much of anything unless a button is being pushed, or it is writing to the LCD. Writing to the LCD takes less than half a second. I don't measure anything, I don't input anything, I don't monitor anything, I don't drive anything. I just loop around and around until I catch an interrupt, and after that, I count how many counts the button is down to figure out if I have a click, a double click, a short hold, a long hold or a really long hold. Then I change the LCD accordingly and start looping again. Every time I start looping, I reset the counter to zero and start over. The only reason to count is to find a point in time where I decide it's been on long enough, then I put it to sleep. Doesn't matter what the display shows, although now that I think about it, I'd probably do a shorter time-to-sleep if I'm resting at the menu, longer if I've got the key displayed.
Now what do you think? Still don't like it or livable? Trying to keep it simple.
BTW, I'm going to give this a shot: http://www.instructables.com/id/Cheap-LIR2032-Coin-Cell-Charger/