My wife had been after me for a while to make her a necklace with a copper pattern. At last I got around to it this past week. I learned a few new things and it was also pretty good solder paste practice.
The necklace itself is four jewel style LEDs that run off an ATtiny13 and are powered by a CR2032 coin cell battery. The program starts the Timer in Normal Mode with a 1024 clock divisor and then goes to sleep. When it wakes up on the timer overflow it increments a variable and goes back to sleep. Once the variable exceeds a threshold the MCU makes the LEDs blink around a bit, resets the variable and goes to sleep once more. The ATtiny13 is clocked at 600kHz and the variable threshold is calibrated to make the LEDs run about once an hour.
It had been my intent to clock the MCU at 128kHz to save the extra power. The first time I tried to set up that clock I had AVR Studio set to the the wrong MCU type. I bricked the MCU. Doh! As I discovered however, with an extra person applying leverage with an exacto knife, you can use an embossing gun to pop the chip off with little to no damage to the PCB.
Having mounted a new chip I tried to set up the clock once more. After the clock was set to 128kHz I could not talk to the chip any more. It seems that little note about making sure the ISP clock is less than 1/4 the MCU clock is for real. My ISP's clock speed is adjustable, but I learned at that moment that 56k was as low as it would go. Another MCU bricked. Doh!
The third chip was the charm because I decided that I could live with 600kHz. The docs say that in sleep mode at 1MHz the chip draws 24uA. I was able to turn off a couple extra peripherals and am running lower than 1Mhz so hopefully I'm doing better than 24uA and will get a decent life out of my coin cell. However, even with the 1024 divisor the chip has to wake up more often than twice a second to increment the variable. I guess we'll see what the ultimate battery life really is.
No comments:
Post a Comment