Friday, 6 January 2017

memory - Beginners question: store data


I'm going to build a switching device for my guitar effect units. I want to integrate some simple form of memory, which should be able to store some on/off states, even when power is off. However, I still don't know much about electrical engineering, and I really don't know where to look for the right information. Thanks to google I came up with 3 possible solutions myself already: -Use latching relays. However, this is quite expensive, and I don't know how well the relay keeps its state when moved.


-Use EEPROM or something like that. However, since I'm still a beginner, I really don't understand how these things work and how I can control these things


-Use CPLD. Seems like the best solution. Only problem is that I need to buy some expensive cable to connect the chip to my computer.


Can you please give me some advice on how to do this? I really don't know what to look for!



Answer



I'm trying to get an idea of what those on/off states may be. They shouldn't be mechanical switches; they maintain their state also when power is switched off. Unless you're afraid the may be toggled accidentally in transport. No memory can help you here: there's no electronic way to switch it back to the right state.

So the question is: what are those states and how are they currently controlled? They should be electrically or electronically controlled, or at least be able to control that way.


Let's look at the options you suggest:



  1. the latching relay looks simple, but control-wise you'll have the same problem as with a microcontroller solution.

  2. the EEPROM is the most logical choice to store settings, but it can't do anything on its own; it will need a microcontroller.

  3. the CPLD. I find this a strange one, especially since it's much more complex to interface a CPLD to an EEPROM than it is for a microcontroller, and you mention expressly that you're a beginner.


Suppose one of the states is a transistor's. Could be a transistor that switches a relay, or switches an sound effect in a circuit. In any case, it must be used as a switch. You would read the state into a microcontroller, which stores it into nonvolatile memory at power-down. When the device is powered-up again, the controller would read the state from the nonvolatile memory and set the transistor accordingly. The original signal which controlled the transistor would have to be cut, otherwise it would conflict with the microcontroller's signal. So the microcontroller would also have to monitor this signal continuously and switch the transistor accordingly.



edit

the transistor may control just anything, like a relay. Low level audio signals can be switched by compact reed relays, which usually require less power.
enter image description here
Or you could use integrated electronic switches like the 74HC4066 and you may even not need the transistor.



The program for the microcontroller is easy, basically just copy an input pin to a corresponding output pin, and save to EEPROM. For the former you could use a CPLD , but like I said writing to EEPROM and reading from it is much more involved for a CPLD than for a microcontroller.
There are some microcontrollers which have on-chip EEPROM, like Atmel AVR, but you could also use an external serial EEPROM.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...