Anyone willing to write a small code?

Started by yobleduwop, January 22, 2007, 07:04:52 PM

Previous topic - Next topic

yobleduwop

I need a small, well i hope its small avr code written, i don't know what chip to put it onto either,
The code is basically a whole bunch of switches, 12  3pdt in total, Two of the poles to switch audio signal between an output and ground and the last pole to switch an led on or off, i would like it all controlled by simple push button switches.
Is this a small simple code or is it more difficult,
Should i be a man and learn avr myself or can someone whip this up for me?
Thanks Joel

RaceDriver205

Its really not that simple yobleduwop. Are you OK at doing PCBs? Coz you'll probably need one.
The AVR will be connected to the 12 pushbuttons and LEDs and will provide the 4-bit selection code for the 4051 analog multiplexers. The code will be fairly short and simple to do this task (and I can do it), but you'll need to work out how to connect up the multiplexers
In short, its not a 'whip-up' job.
If you don't have a programmer, you will have to build one of those too (but its easy to make).

If your really looking for simple, you could use a single rotary switch for this task, and label each rotary position with CD,DVD etc. Do you still want to pursue the (harder) AVR based system?

yobleduwop

I'm keen to learn avr which is the main reason why i'm trying this route but i think i might go for the simple rotary switch,
Ive been told that those rotary switches let in a pop and can be quite noisy, are they any worse than the avr option or is the pay off not going to be worth it,
If i do use a switch how can i make it quiter,
Thanks Joel

RaceDriver205

The pop is not directly caused by the switch. The pop is caused by the output capacitor of the device (ie. the CD) and the input capacitor of the amp being at different voltages. The solution is to put a resistor from the output of the device to ground, and the input of the amp to ground (fairly high, say 1MegOhm).

If you want to learn AVR you'd best start with something introductory. I recommend you buy a good beginners book.

danngreen

Have you considered using relays? This could be done without microcontrollers, you'd just need a schmidt trigger to de-bounce the pushbutton, and a latch/flip-flop...

yobleduwop

I still run into the problem of when i hit say switch 4 and ive just been using 6, i need 6 to turn off and i wont be using them in any order so i need it on all 12

RaceDriver205


I designed this circuit a fair while ago, but it never got tested. The switches (which are actually SPDT pushbuttons) each switch on their respective relay, and turn off all the others. Like I said, I never tested it for real though. The only thing I can see that might stop it working, is if the transistion period of the switch (when the pole is connected to neither throws) is just long enough for the relay to flick off.

The relays can of course be 3PDTs, and an LED can be added in parralel to each relay coil to indicate it is on. If you (or anyone else) would like to test it, that would be awesome. If you like, I can explain how it works.

yobleduwop

Would a circuit that had a reset for each one of the 4053 or relays, what ever was used, that had a reset to take them all back to a state, that being off of course, and then you had almost a delayed switch that first reset all the relays then sent power to relay that was needed.

RaceDriver205

Ill admit that I find it difficult to understand you, yoble. Also, is my circuit not the solution to your last question? Switches and relays?
Another circuit you might like is in this thread:
http://www.diystompboxes.com/smfforum/index.php?topic=46405.msg341268#msg341268
about half way down the page.
It is cascadeable to give any multiple of 4 switches (of which 12 is the third). You could use 4053s with it, and its all discrete (no PIC/AVR) parts.

Surely, one of these is exactly what you want?

yobleduwop

I didn't quite understand the schem you put in this thread,
Ill just start breadboarding some stuff, Thanks for your help

RaceDriver205

I said clearly that I would explain it to you if you wanted, and my explanation of what it was was also very clear.
But OK, nevermind, we'll call it a day then. I really think you need to go right back to basics as far as electronics goes.
Good Luck with your project.

yobleduwop