Main Page | File List | Globals

analog.c File Reference

#include <msp430x16x.h>

Include dependency graph for analog.c:

Include dependency graph

Go to the source code of this file.

Functions

void init_a2d (void)
void init_dac (void)


Function Documentation

void init_a2d void   ) 
 

Definition at line 48 of file analog.c.

Referenced by init_bsp().

00048                     {
00049   // Setup the AD converter as follows:
00050  
00051   // %% ADC12CTRL0 %%
00052   // Sample-and-Hold Time - 4uS (32 SMCLK) - with Rs=1k -> 1.88uS is required
00053   // 2.5V internal reference - 5V external signals are divided by 2 before the op-amp buffer
00054   // MSC bit tells convert to immediately convert next channel after started by SHI
00055   // 
00056   ADC12CTL0 = SHT11+SHT10+SHT01+SHT00+MSC+REF2_5V+REFON+ADC12ON;  
00057   ADC12CTL1 = SHP+ADC12DIV2+ADC12DIV1+ADC12DIV0+ADC12SSEL1+ADC12SSEL0+CONSEQ1+CONSEQ0;
00058   ADC12MCTL0 = 0x10;  // AD0 
00059   ADC12MCTL1 = 0x11;  // AD1 
00060   ADC12MCTL2 = 0x12;  // AD2
00061   ADC12MCTL3 = 0x13;  // AD3
00062   ADC12MCTL4 = 0x14;  // AD4
00063   ADC12MCTL5 = 0x95;  // AD5 (End of Sample Sequence)
00064 }

void init_dac void   ) 
 

Definition at line 66 of file analog.c.

Referenced by init_bsp().

00066                     {
00067  DAC12_0CTL = DAC12LSEL_0 + DAC12IR + DAC12AMP_7 + DAC12ENC; 
00068  DAC12_1CTL = DAC12LSEL_0 + DAC12IR + DAC12AMP_7 + DAC12ENC; 
00069 }


Generated on Fri Nov 3 14:40:12 2006 for hwiflib by  doxygen 1.3.9.1