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.

Analog outputs on the MSP430 value line of processor

Other Parts Discussed in Thread: MSP430G2121, MSP430G2131, MSP430G2221, MSP430G2231

I am looking for an MSP430G2xxx device that has I2C and an analog output.

The analog output will do 0-5V or 0-10V out with 0.1% accuracy. Can this be accomplished using

one of the timers on the MSP430? The analog output needs a 12 bit DAC type of resolution.

Can this be accomplished with the MSP430G2121?

  • Even the none-value-line MSP430 cannot do that. It is not likely that the value-line devices can do that.

  • Use the product search: http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?sectionId=95&tabId=2662&familyId=1937&family=mcu

    Doesn't look like the Gxx range have analog outputs / DACs but you wouldn't be able to directly drive 5-10V out anyway.

     

    Use the timer PWM feature (e.g. output in Reset/Set mode) to control a gate switching your 5-10V source into an RC network.  Feed this into a buffer (non-inverting amplifier) to allow current draw without significant voltage drop.

  • I2C is accomplished with a universal serial interface (USI)

    Analog output can be accomplished with a 16-bit timer with two capture/compare registers, configured for PWM output

    From the MSP430 value line parts that are released today, the following devices have those features:
    MSP430G2121
    MSP430G2131
    MSP430G2221
    MSP430G2231

    Here is a possible solution.  Set the system frequency (master clock) to 16 MHz using the DCO to maximize the PWM frequency.  Set the PWM period (capture compare register CCR0) to 0FFFFh for maximum resolution.  Vary the PWM period (capture compare register CCP1) from 00000h to 0FFFFh for duty cycle.  The result will be a 0.002% resolution (1/2^16) at a PWM frequency of 244 Hz (16 MHz/2^16)

    One factor using the DCO to consider is that you can operate in active mode and lower power modes 0, 1 and 2.  To make use of lower power modes, you would have to make use of a different clock source, where you would need to trade off either resolution or PWM frequency or a combination of the two.

    Start with the TI code example msp430x20x3_ta_16.c from here
    http://focus.ti.com/mcu/docs/mcuflashtools.tsp?sectionId=95&tabId=1538&familyId=342&DCMP=MSP430&HQS=Other+OT+msp430codeexamples
    Look for “MSP430F20xx, MSP430G2xx”
    The file to use as a starting point is msp430x20x3_ta_16.c

     

**Attention** This is a public forum