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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Frank Milburn's Blog MSP430FR2355 LaunchPad Initial Look and Operational Amplifier Test
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fmilburn
  • Date Created: 23 Aug 2018 6:59 AM Date Created
  • Views 2928 views
  • Likes 8 likes
  • Comments 10 comments
  • msp-exp430fr2355
  • msp430fr2355
  • msp430
  • launchpad
  • ti
  • op amps
Related
Recommended

MSP430FR2355 LaunchPad Initial Look and Operational Amplifier Test

fmilburn
fmilburn
23 Aug 2018

As noted yesterday I have a project in mind that would use operational amplifiers.  Several manufacturers have microcontrollers with built in op amps and yesterday I took a quick look at the MSP430FR2311 from Texas Instruments.  Today will be a quick look at the larger and more powerful MSP430FR2355 which can be obtained on a LaunchPad.  This is a relatively new product and I bought my sample from the Texas Instruments store as it is not yet available from Newark / Element14.  The microcontroller offers the following features:

 

  • 1.8-V to 3.6-V operation
  • 16-Bit RISC architecture up to 24-MHz system *** and 8-MHz FRAM access
  • 32KB of Program FRAM, 512 bytes of Information FRAM, and 4KB of RAM
  • 12-channel 12-bit ADC
  • 12-bit reference DAC
  • Two enhanced comparator with integrated 6-bit DAC as reference voltage
  • Four Smart Analog Combo (SAC-L3)
  • Three 16-bit timers with three capture/compare registers (Timer_B3)
  • One 16-bit timer with seven capture/compare registers (Timer_B7)
  • 32-bit hardware multiplier (MPY)
  • 44 GPIOs

 

The LaunchPad has 40 pin BoosterPack headers, an onboard eZ-FET debug probe, 2 buttons, 2 LEDs, an ambient light sensor, and Grove connector.  They have been making tweaks to the LaunchPad series recently that I like.  For example they come with plastic feet now in the corners that allow them to stand nicely on a table and the buttons are placed such that they don't interfere as easily with BoosterPacks (stacked daughter boards).

image

My interest is the op amps and I will concentrate on those.  The 12-bit DAC can be used for offset and bias settings for the op amps.  The op amps can be configured as buffers, inverting amplifiers, and noninverting amplifiers internally.  The four op amps in the microcontroller can be broken into pairs which can then be put in series.  There is much more to them but for today I will investigate configurable gain in single noninverting mode.

 

Below is code I developed using snippets from the MSP430FR2xx_4xx DriverLib Users Guide pieced together to demonstrate a noninverting op amp.

/*
 * Noninverting Op Amp Example for MSP430FR2355 LaunchPad
 *
 * Configures SACOA0P as a noninverting op amp.
 *    OA0+ is connected externally to Pin 9 (P1.3)
 *    OA0- is connected internally
 *    OA0O is connected externally to Pin 28 (P1.1)
 *
 * Default MCLK = SMCLK = ~1MHz
 *
 * Frank Milburn     August 2018
 * Developed on:
 *    LaunchPad: MSP-EXP430FR2355 Rev. A
 *    Compiler: TI v18.1.3.LTS
 *    CCS: Windows Version 8.1.0.00011
 */
//******************************************************************************
#include "Board.h"
#include "driverlib.h"
int main(void)
{
    WDT_A_hold(WDT_A_BASE);                         // Stop watchdog
    PMM_unlockLPM5();                               // enable GPIO port settings
    // Configure GPIO in OA0 output and noninverting pin configurations
    GPIO_setAsPeripheralModuleFunctionOutputPin(
            GPIO_PORT_P1,                           // Port 1
            GPIO_PIN1,                              // Pin 1
            GPIO_TERNARY_MODULE_FUNCTION);          // Op Amp output pin
    GPIO_setAsPeripheralModuleFunctionInputPin(
            GPIO_PORT_P1,                           // Port 1
            GPIO_PIN3,                              // Pin 3
            GPIO_TERNARY_MODULE_FUNCTION);          // Op Amp noninverting pin
    // Initialize SAC0 as Op Amp and select input sources
    SAC_OA_init(
            SAC0_BASE,
            SAC_OA_POSITIVE_INPUT_SOURCE_EXTERNAL,
            SAC_OA_NEGATIVE_INPUT_SOURCE_PGA);
    //Select power mode
    SAC_OA_selectPowerMode(
            SAC0_BASE,
            SAC_OA_POWER_MODE_LOW_SPEED_LOW_POWER);
    // Select Non-inverting PGA Mode
    SAC_PGA_setMode(
            SAC0_BASE,
            SAC_PGA_MODE_NONINVERTING);
    // Set the gain where valid values for non-inverting mode are any of
    // SAC_PGA_GAIN_BIT0
    // SAC_PGA_GAIN_BIT1
    // SAC_PGA_GAIN_BIT2
    // logically OR'd together to modify the SACxPGA register and give gain
    //         001  010 011 100 101 110 111
    //  GAIN =   2,   3,  5,  9, 17, 26, 33
    SAC_PGA_setGain(
            SAC0_BASE,
            SAC_PGA_GAIN_BIT0 | SAC_PGA_GAIN_BIT1    // GAIN = 5
            );

    // Enable OA
    SAC_OA_enable(SAC0_BASE);
    // Enable SAC
    SAC_enable(SAC0_BASE);
}

The setup is very similar to the code yesterday with the primary changes being to set the mode to noninverting and to set gain internally.  Note that internal gain for a noninverting amplifier is limited to 1, 2, 3, 5, 9, 17, 26, and 33.  For an inverting amplifier the possible settings are 1, 2, 4, 8, 16, 25, 32.  Remembering of course that the op amp could be set up as a general purpose op amp with the circuitry outside the microcontroller as I did yesterday.

 

The test setup consisted of the MSP-EXP430FR2355 LaunchPad, two multimeters, a 1K 1% resistor, a 100K 1% resistor, a breadboard, and jumpers.  The two resistors were used to make a voltage divider which brought the 3V3 rail on the LaunchPad down to 32.7 mV.  The output of the voltage divider was then connected to the noninverting input of the op amp.  In the photo below the op amp has been set to a gain of 5.

image

The code was run at all possible gain settings and the input and output voltages measured with the multimeters.  The readings would stabilize quickly but there was drift which I did not quantify.  Similar to yesterday this initial setup was crude but will have to do for now.  Results are tabulated below.

image

The register settings and the resulting gains are in the first four columns.  The measured input voltage comes next and was quite stable.  Measured output voltage is in the next column and as noted above varied but was not quantified.  The calculated output voltages are simply the input voltage times the expected gain that was set in the firmware.  At unity gain the difference in the measured and calculated values is 1.1 mV or -3.36%.  The measured value stays above the expected value throughout the range of the test but percentage error gradually decreases to less than a percent while the difference in values increases to about 8 mV.

 

I wasn't sure what to expect with this test when I started.  It would be possible to "calibrate" the instrument and develop a correction table or curve fit since error seems to behave in a predictable manner.  As always, comments appreciated.

 

Links

Yesterdays test of MSP430FR2311

MSP-EXP430FR2355 LaunchPad

  • Sign in to reply

Top Comments

  • Fred27
    Fred27 over 6 years ago +3
    TI's Launchpads come out so quickly these days it's hard to keep up! Thanks for the informative overview. The Smart Analog Combo peripheral sounds really useful in some scenarios. I remember evaluating…
  • jc2048
    jc2048 over 6 years ago +3
    Another good blog. TI ought to be giving you boards rather than making you pay for them. From the datasheet, they think the accuracy should be within 1%. But the datasheet also says the typ low output…
  • Fred27
    Fred27 over 6 years ago +3
    By the way, if you haven't already got a code for free shipping from the TI store (until end of 2018) then PM me. It's the one from the "Free shipping in 2018" banner that sometimes pops up but I found…
  • fmilburn
    fmilburn over 6 years ago in reply to Fred27

    I keep thinking I should look at more of the ARM boards.  I am resisting FPGA as best I can :-)

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 6 years ago in reply to genebren

    I find them really handy too.  I have become so used to the MSP430 that it is hard for me to move away from it, especially since they have added FRAM and things like op amps.    I have started playing with ARM a bit but so far haven't really needed the extra features.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Fred27
    Fred27 over 6 years ago

    I've got way to many TI development boards too - including some of the MSP-TS430 series of ZIF socketed boards for those that don't appear as Launchpads.

     

    I've also got a load of STM32 boards that just gather dust, as I decided to make it easier on myself by concentrating on one platform / toolchain. Then there are some Raspberry Pis, some NXP xpresso boards...

     

    I'm currently trying hard to resist the temptation to get into FPGAs.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 6 years ago

    Very nice blog Frank.  I tend to be the same way about development boards, with the exception that the majority of mine are AVR parts.  It is very handy to be able to try out code while I am waiting for a PCB to arrive, or to build a quick tool to test out a board under development.

     

    Keep up the good work!

    Gene

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fmilburn
    fmilburn over 6 years ago in reply to jc2048

    Hi Jon,

     

    Fortunately as hobbies go having a thing for microcontrollers isn't too costly.

     

    Thanks for commenting on accuracy and the datasheet - very helpful.  For those who want to see what Jon is referring to it is in Table 5-25.  Your explanation for what is going on is helpful as I am interested in getting as close to the negative rail as possible and I have stated elsewhere my knowledge about op amps is rudimentary.

     

    Next up:  Put the op amp in follower mode and vary the voltage.  I am also going to put a 10k Ohm output load on the op amp and see what that does.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
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