non-volatile counter

If you are building, for example, an electricity meter, which measures domestic power consumption, one needs to have a good deal of confidence in the reading, both that it is accurate, and that it is never forgotten or glitched.

So what is the accepted technology to hold the non-volatile kwhr count etc. ? - a bit of CMOS RAM , a bit of flash in a micro? A non-vol ROM like RAMTRON ferric memory, or something I haven't heard of?

And, as a s separate question, how are these things engineered to give the necessary confidence that they will run forever? Is a single-chip micro with brownout detect good enough, or does it have to be a non-processor solution still?

David

Reply to
David Collier
Loading thread data ...

The applications I've seen (not electric meters, but cumulative/totalizer apps) keep the running total in RAM and periodically (or on certain quanta of counts) move this to flash.

A factor you didn't yet consider is that real-world flash doesn't give you an infinite number of write cycles (spec has improved over the past couple years and I've never seen the real product do worse than the "typical" number in the spec.) When I've asked, I've been told that some of the totalizer products use multiple locations and checksums and error recovery on detecting that a word in flash has gone flaky. Other flash applications spread their writes around with an algorithm to "spread the badness".

Tim.

Reply to
Tim Shoppa

Gears and little pointers *are* the accepted technology.

You need to make sure that there is enough brown out protection that even the most extreme cases don't mess it up. Micros like the PIC are not touchy about the running frequency so you can monitor the AC on the small transformer that makes its Vcc but run it on power that is well filtered.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

In article , Tim Shoppa wrote: [....]

A simple way to do this is to consider erased to be zero. You write one bit into each byte as you work your way down the page. When you hit the end, you have to erase the page. When you start again you write 2 into the first cell and ones into the rest. The next time you start with a 3 and so on until you put 0FF in the first byte and a 2 in the second.

In real life, you have to toggle between 2 pages so that you write the new count before you erase the old.

This method assumes that the damage is done by the erase operation not the write.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

I like it!

Some automotive odometers used to blow a PROM bit every few miles. If the battery gets disconnected the most lost was 5mi (or some such) off the odometer. The theory was that after 5 x 64K miles, no one cared what the odometer said, particularly if it was a GM product. ;-)

If its a single error, which one would assume with a write failure, a read back after write (if write is bad increment the pointer anyway) should get by the pothole.

--
  Keith
Reply to
Keith

Electricity meters use mechanical counters that for good reasons cannot be resetted either. Electronic unit counters often use batterie buffered CMOS memory. One lithium cell lasts approx. 5 to ten years. Flash or eeprom have the disadvantage that they can only be written a few 10 to 100 k times which makes them unusable if e.g. the count has to be written every few seconds.

Reply to
Peter Heitzer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.