This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

No Voltage at DAC0 pin of teensy 3.2?

I am trying to Write a digital value at DAC0 pin of teensy 3.2 MK20DX256H usisng Keil to get analog value But i get 240mV whereas i should get 3.3V according to the following formula
***Vout = Vin * (1 + DACDAT0[11:0])/4096***

# include "MK20D7.h"



int main()
{

SIM->SCGC2 = 1UL << 12; //Enable Clock for DAC0

DAC0->C0=0XC0 ; //Enable DAC and DACREF=3.3V 


DAC0->DAT[0].DATL=0XFF; 
DAC0->DAT[0].DATH=0x0F;
while(1) 
{


}
}

This is a simple program.please guide what is wrong in this?