adc12_examples

adc12_examples - ADC12SingleChannel,SingleConversionExample:

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ADC12 Single Channel, Single Conversion Example: Assume that the gain G of the current meter example is set so 1A equals the full scale voltage  of 2.5V.  Assume that the the analog input voltage is applied to analog input A0.   How would  we set the ADC12 registers?     unsigned int   in_value, busy; // Initialize control register ADC12CTL0 = 0110 0110 0111 0000  // SHT1x and SHT0x = 66h (both 128 clks), MCS = 0 = no burst mode  // REF2_5V = 1 (2.5V), REFON = 1 = use internal reference voltage  // and ADC12ON = 1 = turn ADC on    ADC12CTL0 = SHT0_6 + SHT1_6 + REF2_5 + REFON + ADC12ON;     / / Initialize control register ADC12CTL1 = 0000 0010 0000 0000 // CSTART ADDx = 0000 =  start conversion with ADC12MEM0, // SHSx = 00 = use SW conversion initiation trigger, ADC12SC bits // SHP = 1 = SAMPCON signal sourced from sampling timer, // ISSH = 0 = sample input signal not inverted,  // ADC12DIVx = 000= divide ADC12CLK by 1,  // ADC12SSEL=00= ADC clock ADC12OSC (~5 MHz), 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/27/2008 for the course ECE 2801 taught by Professor Jarvis during the Fall '08 term at WPI.

Page1 / 2

adc12_examples - ADC12SingleChannel,SingleConversionExample:

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online