K64 DAC0 cannot free run

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

K64 DAC0 cannot free run

780 次查看
haizhouli
Contributor III

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);

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

0 项奖励
回复
2 回复数

624 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

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.

DAC SDK2.x.png

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!
-----------------------------------------------------------------------------------------------------------------------

624 次查看
haizhouli
Contributor III

Thanks. Recompile the code with redlib-nohost, it works. It is due to the semihost. 

0 项奖励
回复