This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123G Multiplex Inputs?

Hi, I have a Tiva C Series TM4C123G.  I've watched a number of YouTube tutorials, have projects built and running using Code Composer and even created my own first little project where I have a potentiometer as input.  The potentiometer is hooked up to GPIO pin PE4 and I've written code that correctly reads the value (0-4096) in a while loop.  

For my next project, I'm wanting as many as two dozen inputs or more instead of just a single potentiometer.  It's pretty clear to me that I don't want to attempt to use 24 pins or more for these inputs, but probably want to use multiplexing for the inputs, correct?  

However, I'm having trouble getting started.  I'm very good at C programming but I'm traditionally not a "hardware guy", but definitely more a "software guy".  I didn't even really know what multiplexing was until recently.  I searched through the data sheet http://www.ti.com/lit/ds/spms376e/spms376e.pdf everything I found but still I'm having trouble getting started.  Can anyone provide any documents or a good starting point for what I'm wanting to do?

Thanks in advance.

  • Hello Bob

    If you do not want to 24 channels of ADC to read the inputs and are OK with using an external multiplexer, then use an analog multiplexer with GPIO control to switch channels externally. There are quite a few from TI like www.ti.com/.../cd74hc4067 (1:16 mux)
  • Hi Amit - Thank you for the quick reply. I was under the impression (possibly mistakenly) that the TIva C Series TM4C123G allowed for some sort of internal multiplexing. Am I wrong?

    I'll ultimately want to use around a total of 30 inputs and possibly as many as 16 outputs. According to the data sheet, there are 43 GPIO pins, so I'm 3 pins short. Any suggestions on the best way to handle this?
  • Amit's idea is good and gives you a lot of inputs. You might also consider adding SPI multi-channel A/Ds.

    In either case I'd suggest using the selection tools at Digikey, Newark or Mouser. They'll give a wider overview of what's available. Some Muxes in particular have the advantage of being available from multiple manufacturers.

    Robert
  • Robert Adsett72 said:
    I'd suggest using the selection tools at Digikey, Newark or Mouser. They'll give a wider overview of what's available.

    Thank you for the info, Robert.  I'm not exactly sure what you mean by "selection tools".  I Googled "Digikey selection tool" (as well as the same for Newark and Mouser) and I'm not sure the links it turned up are exactly what you're talking about.  Could you possibly post some direct links to the selection tools you've mentioned? 

  • Go to digikey, in the search box enter multiplexer. In the 'top results' returns click on 'Interface - Analog Switches, Multiplexers, Demultiplexers'

    www.digikey.com/.../2556671

    You will find similar at Newark and Mouser, although I think Digikey's still leads the pack.

    Robert
  • In support of poster Robert's direction - firm/I also - most always - start our "parts search" (not @ Google) but at Digikey. (and just as he describes...)
  • Ah, okay, gotcha. Thank you both of you for the info. Very helpful.
  • Two tips for using distributers selection tools

    • When the option is available select parts with an active status (avoids selecting parts that are difficult to get or are sitting on the bleeding edge)
    • Select the 'In Stock' checkbox. This ensure you can get the part in a reasonable time. There are parts listed that are not regularly stock and the lead times in those cases can be quite large.

    Robert

  • Hello Bob,

    TM4C devices have at most 24 analog inputs that can be multiplexed internally. This would however cost 24 pins on the device and this option is available in larger pin count packages.
  • Further - may my experience as a 20+ year tech biz owner - argue AGAINST satisfying ALL Signal Needs w/in the MCU? (Any MCU!)

    You will ALWAYS - at some point - require or greatly benefit from "just one more" input/signal, etc.  And if you're, "Confined to the MCU" (Any MCU) you are stuck!   And those MCUs "over-loaded" w/pins are likely to be more expensive and far less available!

    Off-loading your special functions (i.e. Analog Multiplexers) to separate, purpose-designed/built pcbs - enables you to provide (quickly & easily) for any such expanded needs - something which NO Single MCU can (ever) match.

    Flexibility is to be greatly valued - all encompassing solutions (except when they're NOT) - not so much...

  • Hello cb1

    I agree. Saves a lot on routing as well to avoid cross talk on multiple analog signals, close to the MCU.