Maker Pro
Maker Pro

non-volatile counter

D

David Collier

Jan 1, 1970
0
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
 
T

Tim Shoppa

Jan 1, 1970
0
David said:
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?

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.
And, as a s separate question, how are these things engineered to give
the necessary confidence that they will run forever?

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.
 
K

Ken Smith

Jan 1, 1970
0
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?

Gears and little pointers *are* the accepted technology.
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?

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.
 
K

Ken Smith

Jan 1, 1970
0
Tim Shoppa said:
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".

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.
 
K

Keith

Jan 1, 1970
0
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.

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. ;-)
This method assumes that the damage is done by the erase operation not the
write.

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.
 
P

Peter Heitzer

Jan 1, 1970
0
David Collier said:
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?
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.
 
Top