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.

LP-MSPM0L1306: What does the default setting Input Code Through DACCODE0 indicate

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

Hi 

The following sample code is working.
■ opa_dac8_output_buffer_LP_MSPM0L1306_nortos_ticlang

With this sample code, you are trying to set the output value of the DAC.
From the default settings, I tried to set the output to 3.3V by changing the "Input Code Through DACCODE0" to 0xFF in the screenshot below Input Code Through DACCODE0=0 The MCU was built and written to the MCU as 0xFF. However, 3.3 V was not output from PA22 (DAC_OUT).

So I changed COMP_0_INST_DAC8_OUTPUT_VOLTAGE_mV in the source code directly to 1000mV and 3.3V was output.

What does the default setting Input Code Through DACCODE0 indicate?

Thanks,

Conor

  • Hi Conor,

    Actually the DL_COMP_setDACCode0(COMP_0_INST, dacValue) replace the default DACCODE0.

    This is because it is often necessary to change the DAC output continuously in practical applications, so this function is added to the main code of the example.

  • Hi Yuhao,

    If I want the value set in SYSCONFIG to be output, do I change it as follows?

    -----

    DL_COMP_setDACCode0(COMP_0_INST, dacValue);

    DL_COMP_setDACCode0(COMP_0_INST, COMP_0_DACCODE0);

    ---

    It is also not clear why values not used in the sample code are set by default in SysConfig.

    Thanks,

    Conor

  • Hi Conor,

    I think your change can work well. You can also delete the DL_COMP_setDACCode0() in the main code to make the value set in SYSCONFIG to be output.