Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: rechargeable Battery to retain memory during power failure Teensy 4.X

  1. #1

    rechargeable Battery to retain memory during power failure Teensy 4.X

    I have a friend who wanted me to make him a MIDI gadget, I used a Teensy 4.1 for the SD card slot. That done, he now wants me to forget the SD card, and add a rechargeable coin-type lithium battery (easy recharge circuit with a diode and a resistor) to allow the Teensy to go into low power mode and retain it's memory upon power loss (the original use of the SD card).

    Does anyone have any experience and/or ideas about this concept? One concern I have is this type of battery only charges to about 3.1V with the recommended charge circuit, add a diode to prevent back feeding the battery and only provide voltage to the Teensy when no other voltage exists, drops it even further. Or I could possibly use an FET or two to serve the same function, but I'd have to work that one out.

    Any thoughts or advice?

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,026
    Or given you have a Teensy 4.1, just solder a W25Q128JVSIQ or similar flash memory chip to the underside of the Teensy 4.1. This can provide 128 megabits (8 megabytes) of non-volatile memory. Normally it is mounted like a SD card is mounted with a files system, but you may be able to access it as normal memory, providing you make sure the data written gets flushed out to memory. You don't have to power the chip separately, and it being non-volatile, it will not be overwritten with reboots or loading new software.

    There is also a method that you can use the unwritten space in the Teensy's flash memory chip, but there you need to make sure loading new software won't erase the data.

  3. #3
    I proposed that as well, but he is dead set on keeping everything in memory and having a battery backup. Not sure why, but he is somewhat headstrong.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,901
    Flash is memory too.

    maybe design a board to hold a PSRAM alive - would take a smaller battery - and it has RAM in the name. Just the fun of getting it the right voltage at the right time - all the time and not sharing the power

  5. #5
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    852
    Depending on the use case (limited writes, limited size), I second using flash - no battery needed.

  6. #6
    Quote Originally Posted by jonr View Post
    Depending on the use case (limited writes, limited size), I second using flash - no battery needed.
    Unfortunately, the application will require writing data daily, sometimes significant amounts of data, hence using the Teensy 4.1 with possibly adding more PSRAM. And then every day, or few days, off load that data (actually play it back) and then erase and start over. His position is that it's easy to monitor the slow degradation of a battery, but harder to error check an sd card or flash chip.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •