Aug
12
2014
0

Pulsecounter PCB’s have arrived

I posted recently about detecting power loss in an AVR and quickly writing values to EEPROM before power is lost completely and have since received the PCB’s I ordered from oshpark.

This is the first time I have ever ordered professionally made PCBs. I’ve made many using photo resist or toner transfer, but at US$5.00 per square inch for three boards (including worldwide postage) I decided to give it a go. It took a total of three weeks from placing the order to arriving in New Zealand.

This is OshParks render of what the Top was meant to look like

This is OshParks render of what the Top was meant to look like


(more…)

Written by John in: AVR,Electronics,General Randomness |
Jul
09
2014
1

AVR – Detecting loss of power and writing to EEPROM

As part of a recent AVR project, I wanted a way to increment a counter and store it even if the power was lost. This could be done with an external flash memory device, but I wanted to use the internal EEPROM of the AVR.

The internal EEPROM is limited to around 100,000 writes. Independent tests have shown this can be doubled, but 100k writes is only about 27 hours if saved once every second, so not practical for a device I wanted to last at least five years.

It takes a maximum of 34ms (8448us per byte) to write a 32 bit (4 byte) integer to EEPROM. Due to the low power requirements of an AVR, I was confident that a decent sized (say 2200uF) capacitor would allow an AVR plenty of running time to complete EEPROM writes/saves before power is totally lost.
(more…)

Written by John in: AVR,Embedded Systems,Weather Station |