How to get the DAC working on an MKE16F MCU

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to get the DAC working on an MKE16F MCU

999件の閲覧回数
ammarbazzaz
Contributor II

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.

0 件の賞賛
返信
2 返答(返信)

931件の閲覧回数
mjbcswitzerland
Specialist V

Hi

I would check the use of DAC0_STATCTRL.
Bit 0x000080000 enables the DAC but you look to have it still disabled.

Regards

Mark

0 件の賞賛
返信

931件の閲覧回数
ammarbazzaz
Contributor II

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>

0 件の賞賛
返信