DAC Baremetal on FRDM-K64

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

DAC Baremetal on FRDM-K64

跳至解决方案
1,332 次查看
shauldorf
Contributor V

I have very simple working DAC baremetal demo that is working on FRDM-KL25 board.

The tools are KDS v3.2 and KSDK v2

I'm trying to use it also on FRDM-K64.

The DAC init function is

void DAC0_init(void) {

       SIM->SCGC6 |= 0x80000000;   /* clock to DAC module */

       DAC0->C1 = 0;               /* disable the use of buffer */

       DAC0->C0 = 0x80 | 0x20;     /* enable DAC and use software trigger */

}

Executing "DAC0->C0 = 0x80 | 0x20;" causes the program jump to HardFault handler.

174434_174434.pngpastedImage_1.png

 

 

标签 (1)
0 项奖励
回复
1 解答
1,031 次查看
shauldorf
Contributor V

I solved this problem by using SCGC2 register.

pastedImage_1.png

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,032 次查看
shauldorf
Contributor V

I solved this problem by using SCGC2 register.

pastedImage_1.png

0 项奖励
回复