lecNew-14-MoreADCEx

lecNew-14-MoreADCEx - WPI ECE2801 Foundations of Embedded...

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

View Full Document Right Arrow Icon
WPI ECE2801 Foundations of Embedded Computer Systems Lecture 14: More ADC Examples
Background image of page 1

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

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 14 To use ADC12, a programmer needs 1) Select ADC Core Behavior Clock source and divider Sample and hold behavior Reference Voltages 2) Select Conversion Mode required Single channel or sequence of channels, single or repeated conversion 3) Select input channel(s) : INCHx bits in ADCMCTLx registers Has 8 (external) analog input signals or 4 internal analog inputs ADC12's 8 Analog Inputs A0-A7 are multiplexed with Port 6 pins! Ex: Assume input channel A6 and A7 are to be used with ADC12, Port Selection bits for those pins should be set to 1 = Function Select Internal input channels 8, 9 and 11 (INCHx = 1000, 1001, 1011) connected to different reference voltages Internal input channel 10 (INCHx = 1010) is connected to an internal Temperature Sensor. 4) Enable appropriate interrupts (ADC12IE) Write ISR. Should handle all 18 possible ADC interrupts 5) Enable and Start Conversion(s)
Background image of page 2
EE2801: Foundations of Embedded Systems Lecture 14 Example The ADC units on many devices include a temperature sensor. MSP430 has an internal temperature sensor connected to the internal input channel 10 (INCHx = 1010). Configure the ADC12 to sample the internal Temperature Sensor for a measure of ambient temperature.
Background image of page 3

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

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 14 Step 1: Setup ADC12CTL0 Initialize control register ADC12CTL0 = 0110 0110 0011 0000 SHT1x and SHT0x = 6h (both 128 ADC12CLK cycles) MCS = 0 = no burst mode (valid only for sequence or repeated modes) REF2_5V = 0 (1.5V), REFON = 1 = use internal reference voltage ADC12ON = 1 = turn ADC on C instruction: ADC12CTL0 = SHT0_6 + SHT1_6 + REFON + ADC12ON;
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

lecNew-14-MoreADCEx - WPI ECE2801 Foundations of Embedded...

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

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