Flash memory chip as a 1-bit storage. Simple solution

Thread Starter

Costyco

Joined Dec 14, 2020
19
Dear members,

I am in the need of keeping the position of a motor rotor in some kind of non-volatile memory. Basically, it is either "open" or "closed", so only one bit is needed. The motor is stopped at certain positions by a built-in switch and the rotor position of the stopped motor is in turn "open" or "closed".
All I need is to display the rotor position on a remote control panel by the means of a LED. Electrically, there is no difference between these two positions, so the only way to differentiate them is to store the current state in memory and flip it each time the motor is actuated.
I have not come up with anything better than to use a flash memory chip. The motor will be actuated quite rarely, so there is no IC aging issue. The issue is that the flash IC is designed to store kilobytes and I need only one bit. Each time the motor is actuated, a new rotor state must be written to memory. At the same time, the current state must be read and indicated on the LED.
I am not sure if a flash memory can be used for this purpose, so I will appreciate any suggestions. I have an AT29C257 chip on hand, so it would be perfect to use it.
 

LesJones

Joined Jan 8, 2017
4,174
The flash memory chip would need some external logic to control the read and write. I would think an 8 pin microcontroller with EEPROM such as a PIC12F1440 or ATtiny13a would be the simplest solution. I use this method to control motors that open and close curtains. The unit is powered by a plug in timer which switches on for 2 minutes at dusk and 2 minutes at dawn. it just sets or resets a bit in one EEPROM location that decides if it should drive the motors in the close or open direction next time it is powered on. I actually use a PIC16F84 as I had some in stock.
Would it not be simpler to add another micro switch that was only operated in one of the two positions ?

Les.
 

Thread Starter

Costyco

Joined Dec 14, 2020
19
As a matter of curiosity, is it completely impossible to apply VDD to some pins of a flash memory chip and GND to others to select an address and byte? And use flash memory in such a weird application. Any thoughts?
 

BobTPH

Joined Jun 5, 2013
8,811
The trouble with this sheme is that it WILL get out of sync.

If you can arrange for a mechanical switch that senses the position it would be far more reliable. How does the motor know where to stop in the open or closed position? Is there already a switch that does this?

Bob
 

LesJones

Joined Jan 8, 2017
4,174
I am imagining the mechanical part as a disk with two notches spaced 180 degrees apart with a micro switch that drops into the notches to stop the motor. Is this guess correct ? A picture of the mechanics may help us to come up with better solutions.

Les.
 

Thread Starter

Costyco

Joined Dec 14, 2020
19
This is how it is.

new-1.JPG

The above-the-switch rod is a mechanical indicator of the rotor position. It is obvious that the addition of another switch instead of the rod allows to transfer the state over wires. Thanks for trying to find a mechanical solution, but I was trying to find an electrical one. And the suggestion to use a latching relay seem to be the most adequate one.

But I am still curious if it is possible to use a flash memory chip as a 1-bit storage, so any guru thoughts are appreciated.
 

LesJones

Joined Jan 8, 2017
4,174
It should be possible to use that flash memory chip with the address lines set for a fixed address. You would have to design logic to set the state of the NOT CE, NOT OE and NOT WE in accordance with the timing diagrams in the data sheet.
From the mechanical diagram it looks like the motor stops 4 times per revolution.

Les.
 

BobTPH

Joined Jun 5, 2013
8,811
I assume that the circular looking thing the rod is up against is actually a cam that pushes the rod to two different positions based on open and closed.

Attach a switch to the rod and you will have a reliable open / closed indicator.

Any electronic solution based on a memory is, as I said before, not reliable.

Bob
 
Top