Remembering CMOS...

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Swedish Chef

Well-known member
Joined
Jun 7, 2004
Messages
351
Location
London
I have a compressor in development which has a few bits of logic switching in it. Standard fayre with a momentary switch, into a 40106, into a 4013 which then uses BC516s and BC517s to drive the LEDs and relays respectively. The feedback that we've had from engineers so far has been very positive but one point that has cropped up a few times is the unit's inability to "remember" its settings if powered down over night.

All of the switching circuitry has it's own 12V rail and Ground which runs all of the logic, transistors and relays. The unit is out being 'road tested' at the moment but I have been scratching my head thinking about how easy it might be to use a battery to get the flip flops to remember their states, or if I need to scrap all of the logic and do the whole lot with a PIC.

The 1st idea I came up with was to deliver Vcc to the flip flops through diodes and then have a backup battery, again delivered through a diode to prevent interaction between the Vcc when on, and the battery, so that at power off the flip flops "remember" what state they are in until the unit is powered up again.
I can't believe that this is an ideal way to do it, so can anybody shed any light on the subject?

Yours illogically
:shock:

chef
 
We recently discussed a pictured unit (I think it was the distressor) that had a "supercap" in it - said to be there to allow c-mos switching to "remember" it's state over-nite..

Jakob E.
 
Personal opinion -- use a PIC or something low power like an MSP430.

both are easy peasy to program, and you should be able to store the settings in onboard flash memory.

both PIC and MSP430 also have open source tools that you can develop with. Both also have ADC's that you could use to sense the position of pots as well.

just a thought -- PM me if you want any help.

R :green:
 
'Chef wanted to know more, and as the information isn't sacred, I figured it'd be easier to post in the thread.

Firstly - I'm not a programmer - and I don't pretend to be. But at the same time, I could tell you how to go about programming one of these beasties. I don't have 'good' programming skills, I have "just enough to get by" :wink:

The general data here applies for PIC and for MSP430. Personally, I have more experience with MSP430, simply because TI makes them. However I will try to be as generic as possible...

If your doing very simple things, like checking if a switch has been pressed, and then doing something as a reaction (like switching on a relay or LED) then all you need in an infinite loop that will do the following

- check the incoming pins (known as "polling")
- Store the current status in flash
- put a conditional command along the lines of "if pin1=1 then blah blah blah blah".
- Store the output data in Flash
- Set the output pins to reflect any changes.

There are loads of examples on how to do this at www.msp430.com. In fact, the development software and hardware (available very cheaply) start with examples of flashing LED's on and off, moving through using shift registers to clock many inputs to a single pin etc.

if you need a little more assistance, please let me know.

Cheers

R
 
I think there is an error on the TI site at the moment as I can't seem to pull up any data on the chips I want to look at.... :?

chef
 
I can't speak for Microchip, but for MSP430 you can choose either Assembly or C.

MSP430 assembler has only 27 instructions. Learning how to program it is suprisingly simple.

Examples performing the same function are available in both C and Assembler. You should be able to cobble 90% of the code you need from the examples.

Even the low cost MSP430F1121A has 14 I/O pins on it - depending on your application, you may not even need to clock the data in -- just read it straight from the incoming pin.

Olimex do 'header' boards for $10 and a Serial connector to connect to the PC for another $15. The header boards allow you to quickly throw the MSP430 into your project.

Let me know if you have any Q's

Cheers

R
 
I did a good bit of programming on the MSP430 back when I got my BS... heh... I really like this processor! :thumb:
 
[quote author="Swedish Chef"]
The 1st idea I came up with was to deliver Vcc to the flip flops through diodes and then have a backup battery, again delivered through a diode to prevent interaction between the Vcc when on, and the battery, so that at power off the flip flops "remember" what state they are in until the unit is powered up again.
I can't believe that this is an ideal way to do it, so can anybody shed any light on the subject?

Yours illogically
:shock:

chef[/quote]

If you like uCs, like programming, and can handle the clock running and attendant switching noise, then I agree with Rochey et al.

If you want to have a purely static system then the diode steering is a standard approach, with the CMOS itself pulling next to nothing. BUT...you must have the logic not loaded by your LEDs and relay driver Q's or you will have tons of current pulled (relative to the CMOS alone).

One way around this would be to use DMOS driver Q's with essentially zero d.c. drive at their gates. Alternatively, use different CMOS with tri-state outputs that are switched to the high-Z state when you power down.
 
[quote author="Rochey"]I can't speak for Microchip, but for MSP430 you can choose either Assembly or C.

MSP430 assembler has only 27 instructions. Learning how to program it is suprisingly simple.

Examples performing the same function are available in both C and Assembler. You should be able to cobble 90% of the code you need from the examples.

Even the low cost MSP430F1121A has 14 I/O pins on it - depending on your application, you may not even need to clock the data in -- just read it straight from the incoming pin.

[/quote]

May i fill in too, i also program MSP's, and they remakable
easy to program, way a head of a PIC or AVR.

I do most with 430F1232 since it has a neat blend of ADC, UART,
Pins and several different packages from the ultra tiny QFN
packages to the more DIY able SO28 contra unit price.

Remeber tought that dont equal MHz with mips
when it comes to MSP430, both PIC and AVR are faster,
but for doing anything expect DSP thay are darn dandy!

Check out the MSP yahoo group i have been there for
years and its a very good group no spam or flame wars.
Very knoweleged people.

Kkrafs
 
I use supercaps for a lot of memory apps.. you can get them 5VDC at 1F.. yes that's one Farad. I would feed the cap through a Schottky to the device to be powered, make sure that nothing else can drain it off and it'll last a week since you are just keeping the gate charge up and no current will really flow. it works better than you think and at 2$ they are almost a better bargain than batteries since batteries need monitor/charging circuits to actually last any amount of time.
 
I guess that if I ran the relays/ LEDs straight off the logic rail but supplied the logic and SUPERCAP!!!!! through diodes, then run the SUPERCAP through a Schottski (from the cathode side of its distribution diode) to the logic that would avoid the current suck from the relays? Would that work?

The only thing with this scheme is that, if I reason correctly, that if a button is idly pressed whilst the unit is off that will be reflected by the unit on power-up...Is that correct?

Am I going mad? :?

Cheers for the continued input everyone!!! :thumb:

chef
 
just a thought.... it sounds like there's a lot of complex logic going on here. have you considered using a CPLD instead? a CPLD is like an FPGA for dummies. :)

My understanding is that you can put all your logic in that (like software, but routing to actual logic gates on the device) -- I don't think you'll have nasty clocks floating round either.

You could put an 'AND' gate on all inputs connected to the on switch, so that nothing is changed without the on switch being 'on'.
Some CPLD's contain flash as well, which may allow you to save the last status of your system.

just an idea

Cheers

R
 
the 40106 is a schmitt trigger array correct?

this is how i've done simple supercap mem keep-up circuits.

http://www.groupdiy.twin-x.com/albums/userpics/10015/logic.pdf

nothing fancy but use schottky diodes as their V drop isn't nearly as bad as standard silicon.


also, what kind of LEDs are you driving? those 40106 triggers will drive 25ma.. but you would have to SINK the cathodes of the LEDS with the schmitt triggers, instead of sourcing, and supply the anodes with the NON memory logic supply so that you don't drive the LEDs with the memory cap charge. that would get rid of your intermediate driving transistors(i just added that to the schematic)

I think it would work well.. but a prototype will tell you much more than all the math on the planet.. :green:
 
no hate mail if it doesn't work! :green:

let us know how it works out!

I'm kinda interested in using some schmitt triggers on some of my own projects..
 

Latest posts

Back
Top