AnsweredAssumed Answered

K64 DAC0 cannot free run

Question asked by HAIZHOU LI on Nov 1, 2017
Latest reply on Nov 2, 2017 by HAIZHOU LI

I used FRDM-K64F built-in example to test the DAC0. I only need change the voltage from time to time. 

When I run the example in the Jtag debug way and push F8, DAC0 can send a correct voltage output.  

However, when I power cycle the dev board, there is no output. 

 

Then I tried to turn on the soft trigger mode by set the C0.DACTRGSEL to high and write data into the DACx_DAT. still no output. 

 

What is the right register config to drive a very simple voltage output?

 

Thanks!

 

I modified the code as:

 

/////////////////////////////////////////////////////////////////

#define DEMO_DAC_BASEADDR DAC0

dac_config_t dacConfigStruct;

 

BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();

PRINTF("\r\nDAC basic Example.\r\n");

 

DAC_GetDefaultConfig(&dacConfigStruct);
DAC_Init(DEMO_DAC_BASEADDR, &dacConfigStruct);

DAC_Enable(DEMO_DAC_BASEADDR, true); /* Enable output. */


DAC_SetBufferValue(DEMO_DAC_BASEADDR, 0U, 3000);

while(1);

////////////////////////////////////////////////////////////

Outcomes