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.

io pins

Other Parts Discussed in Thread: MSP430F149

Correct me if I'm wrong, but the maximum number of io pins for the MSP430 line is 8? meaning that it can only take up to 8 switches as inputs (maximum)? Is there anyway of doing more, short of encoding switches with logic gates? If that's the case, what is the best ultra-low power, cheap chip that can handle 11-24 io pins?

Thanks!

  • Just as a point of clarification, the MSP430 implements 8 I/O lines per port.  However, there are a number of devices that instantiate multiple Digital I/O Ports to achieve the 11-24 that you are requesting.

  • BrandonAzbell said:
    Just as a point of clarification, the MSP430 implements 8 I/O lines per port.

    Actually, those MSPs with more than two ports usually offer them in a combined manner as 16bit port too.

    And there are MSPs with up to 87 separate I/O lines (10*8-bit or 5*16-bit ports plus a partial port).

    However, for using any hardware function of the internal modules (ADC, UART etc) you'll have to sacrifice a specific I/O port pin for this functionality. And not all MSP ports are interrupt capable (usually only the first two). So you should carefully consider which part of your outer circuitry you connect to which I/O pin.

  • Thanks!

    Sorry, I'm completely new to microcontrollers and am attempting to teach this all to myself! So another probably very silly question: If each port has 8 pins, how do I connect to each individual pin electronically? On the launchpad, I only see one lead for each port...

    Also, if I have 24 pins I want to monitor for an ON signal via connected switches, plus one analog output that should still only take up 4 ports, correct? 

  • Connor Zwick said:

    Sorry, I'm completely new to microcontrollers and am attempting to teach this all to myself! So another probably very silly question: If each port has 8 pins, how do I connect to each individual pin electronically? On the launchpad, I only see one lead for each port...

    When I speak of a port, you can reference the MSP430x2xx Family User's Guide for the Digital I/O section.  A port is a group of registers where within a given register (for example the P1IN - Port 1 Input Data Register), each bit represent a single I/O.

    Each of these single I/Os will be propagated to a device pin (one).

     

    Connor Zwick said:

    Also, if I have 24 pins I want to monitor for an ON signal via connected switches, plus one analog output that should still only take up 4 ports, correct? 

     
    Basically.  24 I/Os configured as inputs and a pin connected to an on-chip Analog-to-Digital Converter (ADC) channel.
  • Thanks!

    One more question to that end. I've found a couple of resources online of people generating frequencies with the MSP430 in a bunch of different ways:

    http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/99607.aspx

    http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/186070.aspx

    http://www.msp430launchpad.com/2011/06/simple-launchpad-dac.html

    http://franktu.com/sine_wave_generator.htm

    However, I'm afraid I haven't read enough quite yet to be able to determine the best solution to my problem: If I want to generate frequencies between 1-10kHz dynamically, is it at all possible with the VLO? Or is the frequency just too slow for that? Do I need an external clock crystal like the one provided with the LaunchPad and will this take up more power? Any helpful links would be greatly apprecaited!

  • Below are a couple of application notes that go into the theory of using a PWM timer for implementing a DAC.

    Using the VLO to generate a 1-10KHz signal is not going to be possible.  The frequency is too low.

    PWM DAC Using MSP430 High-Resolution Timer

    Using PWM Timer_B as a DAC

  • By using Timer_B, doesn't that require the external crystal? If so, does that require a lot of additional power? Thanks!

  • Connor Zwick said:

    By using Timer_B, doesn't that require the external crystal?

    Not necessarily.  The Timer_B module has 4 possible clock inputs as described in the particular MSP430 Family User's Guide for the device you are targeting.  How these reference clocks map to specific clock nets within the device is described in the specific device datasheet.  For example, Timer_B for the MSP430F149 (talked about in the application note above), can have a clock from 1 of 3 sources, ACLK, SMCLK or TBCLK.  TBCLK can be generated from a device pin supporting an external clock reference.  ACLK is generally the low frequency clock reference either from VLO or an external watch crystal (32KHz).  SMCLK can be sourced from an external crystal, oscillator or the internal DCO.

     

    Connor Zwick said:

    If so, does that require a lot of additional power?

    If you use an external crystal, yes, it will consume more power.

  • Could the SMCLK be sourced from the internal DCO and produce a high enough frequency (several mHz at least) while consuming less power than attaching an external crystal? 

  • Connor Zwick said:
    a high enough frequency (several mHz at least)

    Note that a milli hertz (mHz) is a very low frequency indeed!

    I guess you mean mega hertz (MHz)...?

    The upper/lower case is significant!

  • haha, yes I think everyone knew what I actually meant ;)

    apologies for the typo. 

  • Connor Zwick said:

    Could the SMCLK be sourced from the internal DCO and produce a high enough frequency (several mHz at least) while consuming less power than attaching an external crystal? 

    What series of MSP430 devices are you targeting?  Depending on the series, there is a different clock module used.  Look at that Family User's Guide to see the structure of the clock module and how SMCLK can be configured.

    Have you reviewed this already?  If you have and have specific questions, I can help clarify.  However, right now you are asking general questions which are difficult to provide a precise response because "it depends".  I would much rather talk about specifics as you are reviewing the material.

**Attention** This is a public forum