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.

MSPM0G1505: How to set COMPx_IN3+ in SysConfig

Part Number: MSPM0G1507
Other Parts Discussed in Thread: MSPM0G3507,

Hi experts,

I understand from the original thread that there is an issue. As an alternative solution, is the following method correct?

  1. Import "empty_lp_mspm0g3507_nortos_ticlang"
  2. Switch the device to MSPM01507, VQFN-24 in .syscfg
  3. Add COMP0 and COMP1, and select "input positive enable" for each
  4. Select "IN0+" for COMP0, and "DAC_OUT(12-bit)" for COMP1
  5. Since DAC12 causes an error, uncheck "Enable DAC" and check "Enable DAC Output"

In the vqfn-24 package of MSPM0G1507, the positive input for comp1 is only in3+. The dac12 is internally connected, so this selection is made.
I am attaching the .syscfg that is being used.

/**
 * 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 "MSPM0G150X" --part "Default" --package "VQFN-24(RGE)" --product "mspm0_sdk@2.07.00.06"
 * @v2CliArgs --device "MSPM0G1507" --package "VQFN-24(RGE)" --product "mspm0_sdk@2.07.00.06"
 * @versions {"tool":"1.25.0+4268"}
 */

/**
 * Import the modules used in this configuration.
 */
const COMP   = scripting.addModule("/ti/driverlib/COMP", {}, false);
const COMP1  = COMP.addInstance();
const COMP2  = COMP.addInstance();
const DAC12  = scripting.addModule("/ti/driverlib/DAC12");
const GPIO   = scripting.addModule("/ti/driverlib/GPIO", {}, false);
const GPIO1  = GPIO.addInstance();
const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
const VREF   = scripting.addModule("/ti/driverlib/VREF");

/**
 * Write custom configuration values to the imported modules.
 */
const gate8  = system.clockTree["MFPCLKGATE"];
gate8.enable = true;

COMP1.$name                   = "COMP_0";
COMP1.channelEnable           = ["POS"];
COMP1.enableExchangeInputs    = true;
COMP1.vSource                 = "DL_COMP_REF_SOURCE_VREF_DAC";
COMP1.terminalSelect          = "DL_COMP_REF_TERMINAL_SELECT_NEG";
COMP1.setDACCode0             = 0x2A;
COMP1.setDACCode1             = 0x6;
COMP1.posChannel              = "DL_COMP_IPSEL_CHANNEL_1";
COMP1.peripheral.$assign      = "COMP0";
COMP1.compPinPos1Config.$name = "ti_driverlib_gpio_GPIOPinGeneric1";

const Board                       = scripting.addModule("/ti/driverlib/Board", {}, false);
Board.peripheral.$assign          = "DEBUGSS";
Board.peripheral.swclkPin.$assign = "PA20";
Board.peripheral.swdioPin.$assign = "PA19";

COMP2.$name         = "COMP_1";
COMP2.channelEnable = ["POS"];
COMP2.posChannel    = "DL_COMP_IPSEL_CHANNEL_5";

DAC12.dacEnable          = false;
DAC12.dacOutputPinEn     = true;
DAC12.peripheral.$assign = "DAC0";
DAC12.OutPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0";

GPIO1.$name                          = "GPIO_LEDS";
GPIO1.port                           = "PORTA";
GPIO1.associatedPins[0].$name        = "USER_LED_1";
GPIO1.associatedPins[0].initialValue = "SET";
GPIO1.associatedPins[0].assignedPin  = "0";
GPIO1.associatedPins[0].pin.$assign  = "PA0";

SYSCTL.forceDefaultClkConfig = true;
SYSCTL.MFPCLKEn              = true;
SYSCTL.peripheral.$assign    = "SYSCTL";

VREF.basicVrefPins                 = "VREF+-";
VREF.checkVREFReady                = true;
VREF.vrefPosPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric9";
VREF.peripheral.$assign            = "VREF";
VREF.peripheral.vrefPosPin.$assign = "PA23";
VREF.peripheral.vrefNegPin.$assign = "PA21";
VREF.vrefNegPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric10";

const ProjectConfig              = scripting.addModule("/ti/project_config/ProjectConfig", {}, false);
ProjectConfig.migrationCondition = true;

/**
 * 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.
 */
COMP1.peripheral.compPinPos1.$suggestSolution = "PA18";
COMP2.peripheral.$suggestSolution             = "COMP1";
DAC12.peripheral.OutPin.$suggestSolution      = "PA15";

Best regards,
O,H