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);
////////////////////////////////////////////////////////////
Hi HAIZHOU,
Test the dac basic example on FRDM-K64F board with onboard J-Link firmware application, the Pin11 of J4 will output 2.38V.
C:\SDK_2.2_FRDM-K64F\boards\frdmk64f\driver_examples\dac\basic
You can download SDK_2.2_FRDM-K64F from here.
I am using KDS3.2 with FRDM-K64F Rev E3 board.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------