Hello,
For MSP430F1612, for DAC12 I cannot enter the value in DAC12_0DAT. Below is the code and also the screenshot of IAR. As you see, no data loaded in DAC12_0DAT, neither voltage on P6.6/DAC0 processor pin.
Any idea for fixing this?
//dis GIE
__bic_SR_register(GIE);
//init P2.2 LOW
P2IES &= ~P2IES_5; //dis int P2.5
P2IFG &= ~P2IFG_5; //reset P2.5 int flag
P2SEL &= ~P2SEL_5; //P2.5 IO
P2DIR |= P2DIR_5; //P2.5 OUT
P2OUT &= ~P2OUT_5; //OUT Low
//Voltage reference ADC12, DAC12
ADC12CTL0 |= REFON; //en VREF
ADC12CTL0 &= ~REF2_5V; //VREF=2.5V
//init P6.6 DAC12_0
P6SEL |= P6SEL_6;
P6DIR |= P6DIR_6;
P6OUT |= P6OUT_6;
//DAC12 settings
//conv. DIS when DAC12LSELx > 0
DAC12_0CTL &= ~DAC12ENC;
//dis INT
DAC12_0CTL &= ~DAC12IE;
//ungroup DAC12x
DAC12_0CTL &= ~DAC12GRP;
//ref: VREF+
DAC12_0CTL &= ~DAC12SREF1;
DAC12_0CTL &= ~DAC12SREF0;
//12-bit res
DAC12_0CTL &= ~DAC12RES;
//conv. starts if DAC12ENC
DAC12_0CTL &= ~DAC12LSEL0;
DAC12_0CTL &= ~DAC12LSEL1;
//DAC12 full-scale output = 3x reference voltage
DAC12_0CTL |= DAC12IR;
//High speed & DAC12_0 OUT. P6.6 selected aotomatically for DAC12_0 out
DAC12_0CTL = DAC12AMP0 + DAC12AMP2;
DAC12_0CTL &= ~DAC12AMP1;
//data IN: straight binary
DAC12_0CTL &= ~DAC12DF;
//clear IF
DAC12_0CTL &= ~DAC12IFG;
//DAC12 calibration. Must be completed BEFORE DAC12 use
//DAC12_0CTL |= DAC12CALON;
DAC12_0CTL &= ~DAC12CALON;
//DAC12 conv.
DAC12_0CTL |= DAC12ENC;
DAC12_0DAT = 0x0A00;
DAC12_0DAT = 0x0B00;
DAC12_0DAT = 0x0C00;
