Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Re: Best way to save Odometer reading???

Discussion forum for the BasicX family of microcontroller chips.

Best way to save Odometer reading??? - Jim - Sep 20 20:20:13 2006

I'm working on a project that I'm using a BX-24P to read information
from a motorcycle and display it on a screen. I'm trying to figure the
best way to store the odometer & Trip odometer readings. I'm going to
use another processor to count the speed pulses and report them to the
BX when asked to. This may be several times a second. While in the
running mode, I don't need to store store them, but I need to retain
them for the next running of the device.

I'm just not sure what is the best way to keep from burning out a
EEPROM Location. I'm thinking of writing only once a minute.

Is there a better way. Maybe to detect that the unit is loosing power
and write them to a persistent var???

Any ideas would be greatful.

Thanks,

Jim



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


RE: Best way to save Odometer reading??? - stevech - Sep 21 6:20:11 2006

Battery backup and sleep mode?

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Jim
Sent: Wednesday, September 20, 2006 5:16 PM
To: b...@yahoogroups.com
Subject: [BasicX] Best way to save Odometer reading???

I'm working on a project that I'm using a BX-24P to read information
from a motorcycle and display it on a screen. I'm trying to figure the
best way to store the odometer & Trip odometer readings. I'm going to
use another processor to count the speed pulses and report them to the
BX when asked to. This may be several times a second. While in the
running mode, I don't need to store store them, but I need to retain
them for the next running of the device.

I'm just not sure what is the best way to keep from burning out a
EEPROM Location. I'm thinking of writing only once a minute.

Is there a better way. Maybe to detect that the unit is loosing power
and write them to a persistent var???

Any ideas would be greatful.

Thanks,

Jim

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Best way to save Odometer reading??? - Tom Becker - Sep 21 6:53:02 2006

http://tech.groups.yahoo.com/group/basicx/files/Datasheets-Appnotes-Examples-Drawings/Code%20Techniques/
AVR101.pdf is Atmel's discussion of a circular buffer in EEPROM.
You'll also find 120000-hour Hobbs-like running hour meter code there.
An odometer shouldn't be much different.
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Best way to save Odometer reading??? - Don Kirby - Sep 23 8:25:52 2006

Ahh Yes... Dealing with EEPROM write cycle limits..

Tom hepled me greatly with my hour meter project (thanks again Tom).

You can certainly use a circular buffer to increase the life span of
the EEPROM. Basically, you'll write the value to location #1 the
first time you store it, then to location #2 the second time, then
location #3, and so on. At some predeteremined number, you cycle back
to location #1. The overall lifespan gets multiplied by the number of
locations you use. It works well, as I've had my Hobbs Meter running
for thousands of hours, recording the time every minute, without even
a hiccup. Sounds complicated, but in reality, it's not that hard.

The other method, as was already suggested, is to use a battery
backup. Power the BX from the motorcycle's battery, on a switched
circuit. When the power is switched off, the BX continues to run on
it's backup battery. It would be a simple matter of watching the
switched power's voltage to determine when it's off. Store the odo
reading only at that time, then put the BX into standby untill the
switched power rises above a preset level.

As an aside to method #2, I'm certain that if you're displaying other
information as well, you would be monitoring the motorcycles battery
voltage anyway. Also, the backup battery is a good idea to avoid the
BX going into reset mode during engine cranking as the system voltage
will drop quite a bit. Depending on which voltage regulator you are
using to power the BX, the 5 volt output might not be available with
input voltaged below 7 volts or so.

Just blabbering here...
You could use a capacitor rather than a battery for backup. You only
need a short time for the EEPROM to write, so you monitor the
motorcycle's system voltage, and write the odomoeter value to memory
when it drops below something like 4 or 5 volts. That value should
keep the BX from writing the value during engine start. A simple
diode in series with the capacitor will keep it from draining back
through the motorcycles' electrical system. As soon as the system
voltage comes back up above the voltage regulator's threshold, the
capacitor is charged back up, and the BX runs normally.
HTH

-Don

--- In b...@yahoogroups.com, Tom Becker wrote:
http://tech.groups.yahoo.com/group/basicx/files/Datasheets-Appnotes-Examples-Drawings/Code%20Techniques/

> AVR101.pdf is Atmel's discussion of a circular buffer in EEPROM.
> You'll also find 120000-hour Hobbs-like running hour meter code there.
> An odometer shouldn't be much different.
> Tom
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )