Part Number: MSPM0G3507
Tool/software:
Hello,
I am currently working on a project that uses COMPDAC8x_OUT and OPA functions. I want to use COMP_DAC as an output and feed it to the OPA as an input. However, no matter how I configure the OPA and write the code, there is no response.
When I use the DAC function as the input for the OPA instead of COMPDAC8, the OPA works correctly. But due to pin requirements, I must use COMP_DAC8.
I found a related function in the sample code called "opa_dac8_output_buffer." However, when I use this example, I still don't see any output from the OPA. I tried modifying the example and wrote a test method using the same approach, but it still doesn't work. The OPA still has no output.
As for the environment settings, I did not make any changes.
Could you please tell me if I made any mistakes in the code or if there are any environment settings that need to be changed?
Thank you.
#include "ti_msp_dl_config.h"
/*
* DAC8 Reference Voltage in mV
* Adjust this value according to the internal VREF configuration.
*/
#define COMP_0_INST_REF_VOLTAGE_mV (3300)
/*
* DAC8 static output voltage in mV.
* Adjust output as needed.
*/
#define COMP_0_INST_DAC8_OUTPUT_VOLTAGE_mV (1000)
uint32_t list[]={
2048, 2447, 2831, 3185, 3496, 3750,3940, 4056, 4095, 4056,
3940, 3750, 3496, 3185, 2831, 2447, 2048, 1648,1264, 910,
599, 345, 155, 39, 0,39, 155, 345, 599, 910, 1264, 1648
};
uint16_t count;
uint32_t dacValue;
int main(void)
{
// uint32_t dacValue;
SYSCFG_DL_init();
/*
* Set output voltage:
* DAC value (8-bits) = DesiredOutputVoltage x 255
* -----------------------
* ReferenceVoltage
*/
// dacValue = (COMP_0_INST_DAC8_OUTPUT_VOLTAGE_mV * 255) /
// COMP_0_INST_REF_VOLTAGE_mV;
while(1){
dacValue = list[count++]>>4;
DL_COMP_setDACCode0(COMP_0_INST, dacValue);
DL_COMP_enable(COMP_0_INST);
DL_OPA_enable(OPA_0_INST);
if(count >= 32){
count = 0;
}
}
// while (1) {
// __WFI();
// }
}


