LP-MSPM0L1306: How to Configure a Single ADC Measurement Pin that is not ADC0.0 using SYSCFG in CCS Theia

Part Number: LP-MSPM0L1306
Other Parts Discussed in Thread: SYSCONFIG, MSPM0L1306

Tool/software:

I have been trying to use CCS Theia and the SYSCFG to configure PA21/25 for use in my board as an ADC input.  I can enable ADC12 in the Software tab but there isonly an option to enable Pinmux for PA27/31 which is ADC0.0.  I found a possible configuration in the Reserve Peripherals tab and can setup PA21/25 as ADC0.5 but when I compile the ouputted ti_msp_dl_config.c has nothing ADC related for configuration.  I tried adding ADC12 along with the the Reserve Peripheals configuration but CCS Theia tells me there is a resource conflict.

  • Hi Kenny,

    Can you share with me your ADC12 Sysconfig file? I can take a look at it and see if there's anything wrong with it.

    Best Regards,

    Diego Abad

  • /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "MSPM0L130X" --package "VQFN-32(RHB)" --part "Default" --product "mspm0_sdk@2.01.00.03"
     * @versions {"tool":"1.19.0+3426"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const ADC12         = scripting.addModule("/ti/driverlib/ADC12", {}, false);
    const ADC121        = ADC12.addInstance();
    const GPIO          = scripting.addModule("/ti/driverlib/GPIO", {}, false);
    const GPIO1         = GPIO.addInstance();
    const GPIO2         = GPIO.addInstance();
    const I2C           = scripting.addModule("/ti/driverlib/I2C", {}, false);
    const I2C1          = I2C.addInstance();
    const SPI           = scripting.addModule("/ti/driverlib/SPI", {}, false);
    const SPI1          = SPI.addInstance();
    const SYSCTL        = scripting.addModule("/ti/driverlib/SYSCTL");
    const UART          = scripting.addModule("/ti/driverlib/UART", {}, false);
    const UART1         = UART.addInstance();
    const UART2         = UART.addInstance();
    const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig");
    
    /**
     * Write custom configuration values to the imported modules.
     */
    ADC121.$name               = "ADC12_0";
    ADC121.adcPin0Config.$name = "ti_driverlib_gpio_GPIOPinGeneric8";
    
    const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
    
    GPIO1.$name                          = "GPIO_GRP_LED";
    GPIO1.associatedPins.create(2);
    GPIO1.associatedPins[0].$name        = "PIN_LED_GREEN";
    GPIO1.associatedPins[0].initialValue = "SET";
    GPIO1.associatedPins[0].pin.$assign  = "PA12";
    GPIO1.associatedPins[1].$name        = "PIN_LED_RED";
    GPIO1.associatedPins[1].initialValue = "SET";
    GPIO1.associatedPins[1].pin.$assign  = "PA17/OPA1.IN0-";
    
    GPIO2.$name                          = "GPIO_GRP_CC";
    GPIO2.associatedPins.create(3);
    GPIO2.associatedPins[0].$name        = "PIN_CC_CE_N";
    GPIO2.associatedPins[0].initialValue = "SET";
    GPIO2.associatedPins[0].pin.$assign  = "PA16";
    GPIO2.associatedPins[1].direction    = "INPUT";
    GPIO2.associatedPins[1].$name        = "PIN_CC_INT_N";
    GPIO2.associatedPins[1].pin.$assign  = "PA15";
    GPIO2.associatedPins[2].$name        = "PIN_CC_STAT_N";
    GPIO2.associatedPins[2].direction    = "INPUT";
    GPIO2.associatedPins[2].pin.$assign  = "PA13";
    
    I2C1.$name                             = "I2C_CHRG";
    I2C1.basicEnableController             = true;
    I2C1.basicControllerStandardBusSpeed   = "Fast";
    I2C1.peripheral.$assign                = "I2C0";
    I2C1.peripheral.sdaPin.$assign         = "PA10";
    I2C1.peripheral.sclPin.$assign         = "PA11";
    I2C1.sdaPinConfig.hideOutputInversion  = scripting.forceWrite(false);
    I2C1.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
    I2C1.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
    I2C1.sdaPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric4";
    I2C1.sclPinConfig.hideOutputInversion  = scripting.forceWrite(false);
    I2C1.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
    I2C1.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
    I2C1.sclPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric5";
    
    SPI1.$name                              = "SPI_DRAIN";
    SPI1.chipSelect                         = ["1"];
    SPI1.direction                          = "PICO";
    SPI1.peripheral.$assign                 = "SPI0";
    SPI1.peripheral.mosiPin.$assign         = "PA5";
    SPI1.sclkPinConfig.direction            = scripting.forceWrite("OUTPUT");
    SPI1.sclkPinConfig.onlyInternalResistor = scripting.forceWrite(false);
    SPI1.sclkPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
    SPI1.sclkPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric6";
    SPI1.mosiPinConfig.direction            = scripting.forceWrite("OUTPUT");
    SPI1.mosiPinConfig.hideOutputInversion  = scripting.forceWrite(false);
    SPI1.mosiPinConfig.onlyInternalResistor = scripting.forceWrite(false);
    SPI1.mosiPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
    SPI1.mosiPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric7";
    SPI1.cs1PinConfig.$name                 = "ti_driverlib_gpio_GPIOPinGeneric10";
    
    
    UART1.$name                    = "UART_0";
    UART1.targetBaudRate           = 57600;
    UART1.peripheral.$assign       = "UART0";
    UART1.peripheral.rxPin.$assign = "PA9";
    UART1.peripheral.txPin.$assign = "PA8";
    UART1.txPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric0";
    UART1.rxPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric1";
    
    UART2.targetBaudRate                   = 57600;
    UART2.stopBits                         = "TWO";
    UART2.$name                            = "UART_HDQ";
    UART2.rxFifoThreshold                  = "DL_UART_RX_FIFO_LEVEL_ONE_ENTRY";
    UART2.txFifoThreshold                  = "DL_UART_TX_FIFO_LEVEL_3_4_EMPTY";
    UART2.enableFIFO                       = true;
    UART2.enabledInterrupts                = ["RX"];
    UART2.peripheral.$assign               = "UART1";
    UART2.peripheral.rxPin.$assign         = "PA1";
    UART2.peripheral.txPin.$assign         = "PA0";
    UART2.txPinConfig.direction            = scripting.forceWrite("OUTPUT");
    UART2.txPinConfig.hideOutputInversion  = scripting.forceWrite(false);
    UART2.txPinConfig.onlyInternalResistor = scripting.forceWrite(false);
    UART2.txPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
    UART2.txPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric2";
    UART2.rxPinConfig.hideOutputInversion  = scripting.forceWrite(false);
    UART2.rxPinConfig.onlyInternalResistor = scripting.forceWrite(false);
    UART2.rxPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
    UART2.rxPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric3";
    
    ProjectConfig.deviceSpin    = "MSPM0L1306";
    ProjectConfig.genLibDrivers = true;
    scripting.suppress("Migrating requires going through the Switch Board or Device menu in the Device View section\\.", ProjectConfig, "deviceSpin");
    
    /**
     * These are the reserved peripherals and settings in this configuration
     */
    const iADC1                 = scripting.addPeripheral("ADC");
    iADC1["0"].$used            = false;
    iADC1["1"].$used            = false;
    iADC1["2"].$used            = false;
    iADC1["3"].$used            = false;
    iADC1["4"].$used            = false;
    iADC1["6"].$used            = false;
    iADC1["7"].$used            = false;
    iADC1["8"].$used            = false;
    iADC1["9"].$used            = false;
    iADC1.$name                 = "MyADC1";
    iADC1.$assignAllowConflicts = "ADC0";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    ADC121.peripheral.$suggestSolution         = "<error>";
    Board.peripheral.$suggestSolution          = "DEBUGSS";
    Board.peripheral.swclkPin.$suggestSolution = "PA20";
    Board.peripheral.swdioPin.$suggestSolution = "PA19";
    SPI1.peripheral.sclkPin.$suggestSolution   = "PA6";
    SPI1.peripheral.cs1Pin.$suggestSolution    = "PA3";
    SYSCTL.peripheral.$suggestSolution         = "SYSCTL";
    iADC1["5"].$suggestSolution                = "PA21";
    

    Here is a snap shot of what the UI looks like and the Warning I get in the Ouptut Window.  Attached the syscfg file.

  • Snap showing the Reserved Peripherals

  • Hi Kenny,
    After removing the reserved peripheral option for the ADC, I was able to set the ADC channel to PA25/ADC Channel 5. Basically, it was locking this pin from being used in the regular ADC12 Configuration Initialization. If you wanted to keep the reserved peripheral option, you will have to re-configure the ADC to use the desired channel. Let me know if this fixes your issue.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/ssc_5F00_mspm0l1306.syscfg

    Best Regards,

    Diego Abad

  • Hi Diego,

    I am confused.  I did remove all on the Reserve Periperhal ADC but I still do not see the PA25 option under the ADC12 settings.

  • Hi Kenny,
    Apologies about that, I think I sent you the wrong file. Please try the following one:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/ssc_5F00_mspm0l1306_5F00_1.syscfg
    Best Regards,

    Diego Abad

  • Hi Diego,

    OK I see you sent me a syscfg that should work.  However, this does not answer my question.  How do you use the GUI to do what I am asking?  I want to understand this so next time I can make the change easily.  Did you just edit the syscfg using a text editor?

  • Hi Kenny,

    I didn't edited through the text editor, I still used the GUI based interface in SYSCONFIG. Here's what I did to make it work:

    1. Remove the  Reserve Peripherals instance 

    2. Change the ADC12 Sysconfig ADC Conversion Memory configurations tab (specifically the Memory channel I was using)

    3. Make sure the change applied in the PinMux at the bottom

    If you need a clearer example on ADC Channel configuration, I recommend taking a look at our MSPM0 SDK Example on ADCs (the single channel example should help more.)

    Best Regards,

    Diego Abad

  • Hi Diego,

    Thank You! This explains the issue I was having.  The ability to change this is very obtuse and is hidden under too many menus and the documentation does not do a good job of explaining this.  I recommend an update to CCS Theia to make this more explicit or at least easier to understand.  I looked at the examples you sent all morning before submitting this ticket but it just does not translate into the GUI of CCS Theia well.

  • Hi Kenny,
    Thank you for the feedback. I will pass this feedback to my team. As for the examples you mentioned, my advice for this and future examples is to overview their configuration for any specific location that is able to change the desired feature you want. I agree it takes time to adapt through it, however. You can also opt to code the peripherals manually (the sysconfig output files should show you how to.)

    Best Regards,

    Diego Abad