Author Topic: BCD/Binary code switch to dual (0-15) 7 segment display  (Read 2618 times)

0 Members and 1 Guest are viewing this topic.

Offline MerlynTopic starter

  • Contributor
  • Posts: 35
Hello,

Before asking I did some search on the subject but I couldn't find what I needed.
So we have a BCD/Binary code switch like this one for example:

https://media.digikey.com/photos/Omron%20Elect%20Photos/A6C-16R(N).jpg

What I need is to interface it to a dual 7 segment display which will show numbers 0 to 15 or 1 to 16 corresponding to all 16 positions of the switch. Even better if the code switch can be omitted and an up/down BCD counter used instead.
All this without using uCUs but only common CD series ICs if possible.
I would appreciate if you point me to the right direction.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: BCD/Binary code switch to dual (0-15) 7 segment display
« Reply #1 on: May 24, 2017, 06:22:16 pm »
4543 display driver
4510 counter
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: BCD/Binary code switch to dual (0-15) 7 segment display
« Reply #2 on: May 24, 2017, 06:41:26 pm »
... or build a diode matrix to translate 4 bit hex switch connections to 2x 7 segment digits.    The easiest would be a double sided PCB populated with SMD diodes, but its easy evough to build with through-hole diodes on Veroboard.   Don't fall into the trap of sandwiching the diodes vertically between two Veroboards with tracks at rightangles as it makes rework nearly impossible.  Instead, for the diode top connections its best to use bare wire, with an insulated flywire for output.

Edit: It does need a 4 to 16 line decoder to drive the matrix - the easiest is two 74xx138 3 to 8 line decoders.   Also you may need more drive for the segments so a pair of ULN2003 high crrent drivers on the matrix output may be helpful
« Last Edit: May 24, 2017, 09:20:20 pm by Ian.M »
 

Offline MerlynTopic starter

  • Contributor
  • Posts: 35
Re: BCD/Binary code switch to dual (0-15) 7 segment display
« Reply #3 on: May 24, 2017, 08:26:03 pm »
Thanks for the input. The diode matrix came to mind but I would like to keep it as simple as possible.
I still don't have an idea how to do it and make it unable to count more than 15 or 16 but I'll dig further.
« Last Edit: May 24, 2017, 08:27:54 pm by Merlyn »
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: BCD/Binary code switch to dual (0-15) 7 segment display
« Reply #4 on: May 24, 2017, 08:31:17 pm »
And for still another approach:

You have two seperate problems here:
1) converting 4-bit binary to two 4-bit bcd digits
  a) 10's digit
  -- Either 0 or 1. Solvable with simple logic to determine if the input is greater than 9. Three NAND gates can do that.
  b) 1's digit
  -- Solvable with a 4-bit adder. Using the logic from 10's digit, add 6 if input is greater than 9, else add 0. The bottom 4 bits of the result is the BCD digit.

2) displaying the bcd digits
-- Solved by bcd 7-segment drivers
 

Offline MerlynTopic starter

  • Contributor
  • Posts: 35
Re: BCD/Binary code switch to dual (0-15) 7 segment display
« Reply #5 on: May 24, 2017, 08:58:43 pm »
Turns out it's not going to be that simple after all. It looks like things are heading to uCU direction...
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: BCD/Binary code switch to dual (0-15) 7 segment display
« Reply #6 on: May 24, 2017, 09:24:36 pm »
Yes, its a no-brainer if you've already got the toolchain for an 8 bit MCU family.  If not, its well within the capabilities of an ATmega328P running from its interbal oscillator and programmed using the Arduino toolchain, using an actual Arduino running the Arduino ISP sketch as the programmer if you don't have anything better.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf