Exposing my ignorance...

Hate to do this, but...

How would one simulate the action of, say, a 2P18T rotary switch, using TTL logic, or garden-variety ICs?

I am obviously not an EE, but I want to build something that will simulate the ratation of such a switch with the push of a button, and light up some LEDs to indicate the results of the simulated rotation of said switch. I am thinking I will use a 555 timer in astable multivibrator mode to send clock pulses to something like a 4027 Master/Slave Dual JK flip-flop, or several of these in sequence, to test for a certain set of conditions somewhere along the line, and use Q and NOT-Q of said 4027 ICs to indicate the results of such tests. But I have no idea of how to actually simulate the rotation of a 2P18T rotary switch. Am I on the right track, thinking I might be able to use 4027s? Or is there a better way to accomplish this? Or is this just a stupid question, without enough information to obtain a decent answer?

Cuss or discuss. Any input is appreciated. I am trying to get there, but am obviously not sure which direction to proceed in.

Thanks for any help,

Dave

Reply to
Dave
Loading thread data ...

.

Use a PIC, of course.

-- Many thanks,

Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss:

formatting link
email: snipped-for-privacy@tinaja.com

Please visit my GURU's LAIR web site at

formatting link

Reply to
Don Lancaster

On first thought you counld use a "1 of 18" decoder with a 5bit up/ down counter on the input. A toggle switch selects between "forward" and "back", and a (debounced) push button clocks the input to "change position". Duplicate circuit (except the buttons) twice for a "dual pole" version (or simply cheat and put two LED's in parallel :->). Of course "1 of X" decoders typically only come in 8 or 16 bit versions, and up/down counters in 4 or 8 bit versions. Expand as required to get your 18 positions.

Hope that helps.

Dave.

Reply to
David L. Jones

On Wed, 12 Dec 2007 22:39:15 -0700 in sci.electronics.design, Don Lancaster wrote,

Please remember sci.electronics.design group agreement; whoever says "use a PIC" is expected to include schematic and source code.

Reply to
David Harmon

On Wed, 12 Dec 2007 23:34:44 -0600, "Dave" wrote:

--- Here's a SP18T switch:

View in Courier, all LEDs are high-efficiency 2mA If, ground all unused HC04 inputs.

If you want complementary outputs you could substitute HC175s for the HC164s. Also, the 555 is wired as a one-shot in order to debounce S1. If you want the thing to run endlessly, just wire it up as an astable.

.+5V----+-----------+------+-------+--------+-----------+ . | | |K | |8 | . [10K] [100K] [1N4148] [220K] +---+---+ | . | | | | 2|_ Vcc | | . +--[0.1µF]--+------+-------|---O|T | | . | | 6| | [0.1µF] . | +----|TH 555| |C1 . | O | 7|_ |3 | .S1-->| +---O|D OUT|---+ | . | O | | GND | | | . | |+ +---+---+ | | . | [0.47µF] |1 | | . | | | | | .GND>---+--------------------------+--------+--+----|---+ . | | . +-------------------------------------|----+ . | / |HC04 | . | +------------------O< |----+ | . | | HC164 \\ | | | . | | +--------+ | | . +V | +--|SINA QA|-+--[1N4148>]--+-[10K]-+ . | | | | | | | | .[100K] | +--|SINB | +---[LED>]----|-[2K]--+ . | | |__ | | | . +---+-|---O|MR QB|-+--[1N4148>]--+ | . | | | | | | | | .[0.1] | +----|>CP | +---[LED>]----|-[2K]--+ . | | | | | | | . GND | | | QC|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QD|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QE|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QF|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED]>]---|-[2K]--+ . | | | | | | . | | | QG|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QH|-+--[1N4148>]--+ | . | | +--------+ | | | . | | +-------------+---[LED>]----|-[2K]--+ . | | | | | . | | | HC164 | | . | | | +--------+ | | . | | +--|SINA QA|-+--[1N4148>]--+ | . | | | | | | | | . | | +--|SINB | +---[LED>]----|-[2K]--+ . | | |__ | | | . +-|---O|MR QB|-+--[1N4148>]--+ | . | | | | | | | . | +----|>CP | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QC|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QD|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QE|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QF|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QG|-+--[1N4148>]--+ | . | | | | | | | . | | | | +---[LED>]----|-[2K]--+ . | | | | | | . | | | QH|-+--[1N4148>]--+ | . | | +--------+ | | | . | | +-------------+---[LED>]----|-[2K]--+ . | | | | | . | | | HC164 | | . | | | +--------+ | | . | | +--|SINA QA|-+--[1N4148>]--+ | . | | | | | | | . | | +--|SINB | +---[LED>]------[2K]--+ . | | |__ | | . +-|---O|MR QB|-----[LED>]------[2K]--+ . | | | . +----|>CP | . | | . | QC| . | | . | | . | | . | QD| . | | . | | . | | . | QE| . | | . | | . | | . | QF| . | | . | | . | | . | QG| . | | . | | . | | . | QH| . +--------+

-- JF

Reply to
John Fields

Wow. Thank you, all of you, for your input. This is going to take some time to digest, but you guys have me off and running. ALL of your input is so greatly appreciated.

I'll be back with more questions, I'm sure...

Regards,

Dave

Reply to
Dave

David Harm>Please remember sci.electronics.design group agreement;

I don't remember seeing the vote on that pact.

...and the problem with that proposal is that unless the n00b can get a single LED flashing on his own and subsequently learns to write/debug *his own* code[1], he'll be right back here (like a gnat) posting to the wrong group again with a whole bunch of questions that belong in sci.electronics.basics or comp.arch.embedded. . . [1] ...yielding knowledge which will extend to his FUTURE projects.

If he really isn't interested in *learning* what makes it tick (evidence points to the contrary in this case) and simply wants a *product*, the proper answer is HIRE SOMEONE TO CONSTRUCT WHAT YOU WANT.

Fields' hardware-only solution may trump all of this anyway. We'll see if the OP can get thru *that* without stumbling.

Reply to
JeffM

See the manual.

Nah! That's software. ;-)

--
  Keith
Reply to
krw

On Dec 13, 6:21 am, John Fields wrote: [.....]

I am going to suggest a change to the circuit. Look for the "*"s. I'll explain below:

Modified:

... etc ...

*A the input of a HCT04 is considered high if it is over 2V. For most types of LEDs, the forward drop is much less than 3V.

*B Since only one LED is on at a time, the 2K ressitor can be shared among all the LEDs.

*C LEDs can withstand at least 5V backwards so the one that is not lit isn't harmed by having the backwards voltage on it. (It doesn't light up in the process)
Reply to
MooseFET

...as well including the PCB and parts for free...

Reply to
Robert Baer

Just a note, not meaning to be contentious... I do stumble all the time. That's my life. I just try to fall towards my end goal. :)

Seriously, did I post to the wrong forum? Didn't mean to. Sorry. Will try not to bother you inappropriately again. By the time I do come back though, I may have questions about a schematic I am posting to abse. I am guessing that (questions about the design of a schematic) might belong here?

Thanks,

Dave

Reply to
Dave

Dave, the only problem some people may have here is that they believe the post probably belongs in sci.electronics.basics instead of the design group. It's a blurry line, and I personally think either is ok. Some people can get a little anal about it however. The general etiquette as far as I understand it, is that if you post to the basics groups then no one is allowed to abuse you, or say your post or question is stupid or whatever. But if you post to the design group, then people are allowed to be a bit less merciful.

Regards Dave.

Reply to
David L. Jones

--
I doesn\'t work that way.

The 17 diodes and the inverter make a 17 input NOR gate that decodes
when the first 17 outputs are low and then forces the first serial
data input high.  Then the next clock makes the first Q high which
kills the decode and forces the serial data input low.  Next clock
propagates the high to QB and the low to QA.  That way, as the high
propagates through the register the first serial data input will
always be low until the 18th Q goes high, at which time the 17 lows
from the first 17 outputs will make the input to the inverter low,
making its output high, starting the cycle again with the next
clock.
Reply to
John Fields

The 17 LEDs also makes a NOR if you have the HCT inverter. The ORing action is still done by diodes but in my case said diodes have a 1.7V forward drop instead of the 0.7 Si diodes have. The circuit will act the same.

[.....]

BTW: You can also make this sort of thing with parts like the 4017 and a flip-flop. The tricky part there is the reset on the 4017. The flip-flop toggles at the end of the sweep throught the 4017 outputs so that on the next pass the other LEDs will light.

Reply to
MooseFET

Yeah, that much has become somewhat apparent. Will post to the basics ng next time. Like I said, I'm not an EE, so my questions are probably pretty basic anyway...

Thanks for the reply though. It is appreciated.

Take it easy...

Dave

Reply to
Dave

--
But then you\'d need two resistors.

Even better, use an NPN for the inverter and for the price of the
NPN and a third resistor you can save a chip.
Reply to
John Fields

Yes I forgot to state that the last LED has its own resistor.

Reply to
MooseFET

By 'simulate', do you mean 'implement'? CD4067 is a 16-to-1 analog switch, so two of those gives you

2P16; a little thinking, and add a CD4052 (dual 4-to-1 analog switch) and it gives you 2P19. Ignore the extra switch . It takes five bits of input address to direct this circuit, and that means a five-bit address register.

Use a 5-bit counter to step through the addresses (plus some logic to get the counter to go from 18 to 1 instead of to 19...).

Reply to
whit3rd

Thanks for the input,

I have since figured out a way to do what I want with a 2P6T switch, and found a way to implement the generation of binary 1-6 using 4027 Master/Slave JK Flip-Flops. With a simple counter and some more logic, I think I will be set. Oh, and of course the 555 runing in astable multivibrator mode, so that once the power switch is pressed it all does its thing and then displays the result until the switch is released. No trouble, I am one the way. It just takes time and patience. Do appreciate the serious reply however.

Dave

Reply to
Dave

I'll bet I can do it with a lot fewer than that.

Reply to
Richard Henry

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.