Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

MSP43FG4618 DAC12's configuration problem

$
0
0

I try to receive zero voltage on DAC output (like a test). For my device it is necessary to configure DAC group. Here initialization procedures:

 

void init_DAC0 (void)
{
 // we set 12-bit permission
 DAC12_0CTL& = ~ BIT12;
 // we set the range of the input reference
 // DAC12 voltage to equal 1 multiple reference voltage of Vref +
 DAC12_0CTL | = BIT8;
 // we set the natural binary data format
 DAC12_0CTL& = ~ BIT4;
 // for input and output buffers we set high speed/current
 DAC12_0CTL | = BIT7;
 DAC12_0CTL | = BIT6;
 DAC12_0CTL | = BIT5;
 // we set reference voltage equal Vref +
 DAC12_0CTL& = ~ BIT14;
 DAC12_0CTL& = ~ BIT13;
 // loading in a latch of DAC12 it is realized in case of record in all registers DAC12_xDAT of group
 DAC12_0CTL& = ~ BIT11;
 DAC12_0CTL|= BIT10;
 // the group on this DAC is exposed
 DAC12_0CTL|= BIT0;
 // we disconnect interruptions from DAC12
 DAC12_0CTL& = ~ BIT3; // interrupt enable
 DAC12_0CTL& = ~ BIT2; // interrupt flag
 // we include conversion
 DAC12_0CTL | = BIT1;
 // we launch calibration and we wait for its completion
 /*DAC12_0CTL | = BIT9;
 while ((DAC12_0CTL&BIT9) == 1); */
}


Viewing all articles
Browse latest Browse all 2077

Trending Articles