Electronics > Microcontrollers

Non-Volatile High Write Endurance Storage for PIC24

(1/4) > >>

xquercus:
I've built a direct digital synthesis based VFO around an AD9851 and PIC24F.  It has an LCD display, rotary encoder based control knob and a number of configuration options which I would like to store (tuning step, frequency, lcd contrast, backlight brightness, etc).  This is a hobby project which I intend to use to drive homebrew transceivers. Frequency is the tricky one.  Because this changes so frequently I don't think it's a candidate for storing in flash or eeprom due to write endurance limitations.  I've thought of workarounds such as only saving the frequency if it hasn't changed in 5 seconds, to cut down on writes, but this isn't how any other device I've used works and it would just be strange.  What should I do?

Like my commercial transceivers, the device is intended to be run from mains power -- which might complicate things a bit.  I'm thinking along the lines of two options, neither of which I've explored much, and am hoping for some input.  All of my commercial transceivers with digital tuning have have a button cell which powers some sort of non volatile storage mechanism.  I'm thinking of something along the same lines.  Option one might be to put the PIC into sleep mode (which preserves the internal SRAM) when mains power is turned off and run it off a battery.  I've looked into this a little bit and the main issue for me would be designing a system where the PIC can be driven by both a button battery and mains power.  I also haven't done a precise calculations of battery life so I don't even know if this would be an option.  A second option I've thought of (the one which first came to mind) is to use some sort of external serial SRAM device which refreshes itself using power from the battery alone.  Some looking online has sort of indicated that such devices exist but I haven't been able to find any specifics.

So which track should I follow?  If it's the latter, can someone suggest a particular product/part number to look into?

Thanks!

SeanB:
Look at I2c clock devices, as these often have a couple of bytes of ram in them as well, backed up by the lithium cell you attach to the device. Generally they will retain data and the clock will runh for 10 years ( battery shelf life) and the cells are CR2032 coin cells in a holder. Only need 2 pins, and you probably already are using an I2C device so will have the appropriate code already. It adds an extra feature of a clock in the display as well.

Rufus:

--- Quote from: xquercus on May 26, 2012, 07:35:56 pm ---I've thought of workarounds such as only saving the frequency if it hasn't changed in 5 seconds, to cut down on writes, but this isn't how any other device I've used works and it would just be strange.
--- End quote ---

Why would it be strange? The only time you would be aware of the 'feature' is if you remove power within 5 seconds of the last frequency change. Why would you want to change frequency when you are going to power down in less than 5 seconds?

mariush:
Have you considered using a super capacitor to store enough charge to keep the controller in (deep) sleep mode for about 1-2 days, which should be plenty of time to have it running again?

Or maybe just enough so that if it's powered down for 10-20 minutes, it writes the data to internal eprom?

xquercus:

--- Quote ---Look at I2c clock devices, as these often have a couple of bytes of ram in them as well, backed up by the lithium cell you attach to the device.
--- End quote ---
That's a very interesting idea.  Looking on Mouser I see that Microchip makes an RTC with 64 bytes of battery backed SRAM for a whopping 98 cents in quantity 1.  The chip includes a separate input for the battery and voltage sensing logic.  Just add a 32kHz watch crystal, the battery, and holder...


--- Quote ---Why would it be strange? The only time you would be aware of the 'feature' is if you remove power within 5 seconds of the last frequency change. Why would you want to change frequency when you are going to power down in less than 5 seconds?
--- End quote ---
The only reason it would be strange is that it's different than this type of gear usually operates. 


--- Quote ---Or maybe just enough so that if it's powered down for 10-20 minutes, it writes the data to internal eprom?
--- End quote ---
Hmm... I haven't used a super cap before but that sounds like a fairly elegant solution.  Maybe I could simply have one of the I/O pins detect when Vdd drops (on the supply side of the cap) and have it kick in a save to eeprom routine as soon as power is cut.

I also found an interesting alternative from Cypress:

http://www.cypress.com/?id=3489

Basically it's eeprom backed sram and comes in various serial and parallel interfaces.  It's pretty similar to the idea above about detecting Vdd failure and writing to eeprom when that occurs.  I think the only external part required is storage cap which provides the power to do the eeprom write.  If I recall, the 32kBit modules are $3 from Mouser (not in stock) and the 64kBit modules are $4.  I think that's more than the micro costs but it's an interesting and possible solution.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod