12-input BCD encoder circuit - Page 1
Forum section: electronics / projects

author: Lomax
author_rank: Frequent Contributor
timestamp: January 05, 2020, 06:06:29 pm
content: Hi all,I'm repairing an old synthesizer which has a broken (as in clean off) 12-position C&K (or ITT, or Jeanrenaud) "RT-A" rotary BCD switch (RTA-P-3-ES12-M-25N-S). It turns out (of course) that these are basicallyimpossibleto get hold of - unless you want to order a minimum of 480pcs (which I don't). In contrast, physically identical 12-position single pole rotary switches (RTA-P-3-1S12-M-25N-S) are easy to find - indeed I have a couple lying around already. So I'm thinking a 16-input BCD encoder on a prototyping board could save the day, but it turns outthat's not even a thing. Ok, fine, I can usetwo8-input BCD encoders instead. But now I'm thinking... hmmm... there might be an easier way, e.g. "diode logic", or... something I'm not aware of. Yet. So, my fellow eevbloggers, I come here to ask: how wouldyoudeal with this conundrum?Basically:000000000001 > 0000000000000010 > 0001000000000100 > 0010000000001000 > 0011000000010000 > 0100000000100000 > 0101000001000000 > 0110000010000000 > 0111000100000000 > 1000001000000000 > 1001010000000000 > 1010100000000000 > 1011

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 05, 2020, 06:09:48 pm
content: As often these days, the probably lowest cost and lowest part count solution would be to use an ultra-cheap MCU for this.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 05, 2020, 06:26:40 pm
content: At first glance, looks like four OR gates which could be implemented with diode logic.

author: German_EE
author_rank: Super Contributor
timestamp: January 05, 2020, 07:31:01 pm
content: I'd use an EEPROM with your inputs going to the address lines and your outputs coming from the data pins. Programming only sixteen addresses will be quicker than writing code for an MCU

author: Lomax
author_rank: Frequent Contributor
timestamp: January 05, 2020, 10:10:24 pm
content: Quote from: Wimberleytech on January 05, 2020, 06:26:40 pmThat's what I'm thinking, though a quick sketch indicates I would needtwentyof them. Not a problem; there's plenty of room - just a little fiddly. That said, the transposition selector (which is what the switch is for) apparently uses negative logic; there are no meaningful voltages present between common and any of the bit outputs. So the synth detects the switch position by pins beingpulled low.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 05, 2020, 10:20:05 pm
content: Quote from: Lomax on January 05, 2020, 10:10:24 pmJust for yucks, I created this LTSpice sim. Yup...20 diodes.

author: edavid
author_rank: Super Contributor
timestamp: January 05, 2020, 10:26:45 pm
content: If you'd like to do it with logic ICs, the 74HC148 datasheet shows how.http://www.ti.com/lit/ds/symlink/sn74hc148.pdf

author: duak
author_rank: Super Contributor
timestamp: January 06, 2020, 12:24:02 am
content: There are two optimizations to reduce the number of diodes needed:1.) the single bit BCD codes don't need diodes as the contacts are already isolated. This saves 4 diodes for BCD codes 1, 2, 4 & 82.) if the control board can safely interpret two diode forward voltage drops (ie. 1.2 V) there is a recursive solution where diodes from another code are re-used. eg., 7 is logically the same as 6 ored with 1 so input 7 will have a diode connected to input 6 and another diode to output 1. Likewise input 11 will have a diode connected to input 10 and another diode to output 1.

author: Benta
author_rank: Super Contributor
timestamp: January 06, 2020, 01:06:41 pm
content: Quote from: edavid on January 05, 2020, 10:26:45 pm^ This, or the MC14532.

author: Lomax
author_rank: Frequent Contributor
timestamp: January 06, 2020, 01:54:06 pm
content: This looks doable: