element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum Solutions for a very high number of inputs
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 18 replies
  • Answers 1 answer
  • Subscribers 476 subscribers
  • Views 1852 views
  • Users 0 members are here
  • microcontroller
  • electronics
Related

Solutions for a very high number of inputs

Former Member
Former Member over 12 years ago

I have a rather ambitious project to get started learning about microcontrollers and embedded systems. I have cheaply acquired an old organ console that is currently analog that i want to convert to digital/MIDI. The MIDI out part seems straightforward enough from a bit of Google searching, but I have no idea how to deal with the seemingly massive number of inputs I need. The current console is wired with a common rail that spans each keyboard, voice bank, etc., then each key is individually wired. The straightforward approach to this would seem to indicate that I need 300+ input connections. I understand the concept of shift registers for pulling in all of those lines, but I'm worried about being able to read them fast enough to get me the nearly real-time response I need to make it a usable musical instrument. Thoughts?

  • Sign in to reply
  • Cancel

Top Replies

  • D_Hersey
    D_Hersey over 11 years ago +1
    If I knew your circuit topology for your keyboard, I feel I could be more helpful, that said, couple o' deze, meebe: PCA9505/06 :: NXP Semiconductors
Parents
  • johnbeetem
    0 johnbeetem over 12 years ago

    I actually designed something similar to this several decades ago.  First, some general comments:

     

    1.  Don't worry about "near real-time response".  MIDI only runs at 31.25 kb/s, so you're going to have some delays unless you use time-stamping.  A small amount of delay is actually good because real musicians don't play notes at exactly the same time and if you synthesizer does it will sound artificial.  The same goes for pitch -- I've heard synthesized music sounds more natural if instruments are slightly out of tune with respect to each other.  Of course, you don't want to go too far: "What's the difference between the first chair viola and the last chair viola?  Answer: A measure and a semi-tone."

     

    2.  Do worry about switch bounce.  Mechanical switches do not produce clean on/off transistions.  They tend to bounce between on and off until the contacts settle.  You'll need to filter out these transistions.

     

    So let me tell you what I did back then.  Since the technology was rather different, I'm going to borrow from The Four Yorkshiremen.  I wanted to build a simple polyphonic electronic organ using two 37-key surplus keyboards, with a one-octave overlap to give the usual 61-key organ keyboard range.  These keyboards didn't have switches: "Your keyboard has actual switches?  Pffaaa -- I had to make my own switches out of paper clips with wire insulation stuck over them, and glue each one to the end of a key -- I even had to make my own glue."  (OK, I made up the part about making my own glue.)

     

    Each key had a wire-wrap wire soldered to it and the wires were connected to the inputs of five 74150 16-to-1 multiplexers.  "Pffaaa -- back then we didn't have CMOS or even LS.  In fact, Schottky hadn't even been born yet."  Basically, the five 74150's plus a 74LS151 acted as an 80-to-1 multiplexer to select a key.  An advantage of TTL is that you don't need pull-up resistors on inputs: they automatically float high if not connected.

     

    Now the interesting part: I needed to debounce the inputs but I didn't want to add 80 resistors and capacitors.  Besides, debouncing with RC networks requires that the digital inputs have hystersis (Schmitt triggers) which 74150s don't have.  So I did the filtering digitally.  I used a 256x4 bit SRAM as a bank of 4-bit counters and then time-multiplexed logic to update the counters so that each counter was visited every 250 us or so.  Each visit would read a key's counter value into an up/down counter, increment or decrement the value depending whether the key was pressed or not (saturating at 0000 or 1111), and then write the updated value back into RAM.  If the MSb changed, it meant that the key had been pressed or released long enough for the bouncing to settle.  When MSb changed, the board would interrupt my computer (a Heathkit H-8) which would update my synthesizer board to add or delete a note.  The keyboard scanner was a couple dozen TTL and LSTTL chips and ran at 2 MHz -- a nice solution for 1977 wire-wrap technology.

     

    A scheme similar to this might work for you.  This being the 21st Century, I'd get a microcontroller board with lots of I/O pins such as an ST Discovery board and then add external multiplexers to get your 300 inputs down to 16 or 32, whichever works for your board.  You can do the filtering for 16 or 32 inputs in parallel.  If you don't know the trick, let me know.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to johnbeetem

    John...those were the days when ingenuity was really tested, bought back memories...Rod

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 11 years ago in reply to johnbeetem

    John...those were the days when ingenuity was really tested, bought back memories...Rod

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube