I am having trouble getting output on the DAC0 pin of my MKE16F512VLH16 MCU. Have done the following:
1) PCC->CLKCFG[PCC_PORTE_INDEX] |= 0x40000000; // enable clock on PORT E
2) PCC->CLKCFG[PCC_DAC0_INDEX] |= 0x40000000; // enable clock on DAC0
3) DAC0->STATCTRL |= 0x60800; // enable output buffer, enable test ouput, enable DAC0
4) DAC0->DAT[0] = 1023; //bias_adjust; // send bias adjustment to DAC0 out
But I get no output on the physical Pin (PORTE9 PIN 16 on 64LQFP), expecting to see (1024/4096)*5000mV or 1250mV.
Any suggestions would be greatly appreciated. Thanks in advance.
Hi
I would check the use of DAC0_STATCTRL.
Bit 0x000080000 enables the DAC but you look to have it still disabled.
Regards
Mark
Hi Mark, 5 minutes after posting I realized I was missing a trailing 0 in my |=, so I was off by 4 bits..added a 0 and problem solved! Thank you very much for responding though :smileyhappy:
Best
Ammat
Get Outlook for iOS<https://aka.ms/o0ukef>