DOC PREVIEW
UT EE 345M - Lecture notes

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Using the Stellaris® Microcontroller Analog-to-Digital Converter (ADC)IntroductionSample SequencersModule Configuration ExampleModule InitializationSample Sequence ConfigurationUsing ADC InterruptsData RetrievalDifferential SamplingHardware Averaging CircuitConclusionReferencesAN01247-03 Copyright © 2007–2009 Texas InstrumentsApplication NoteUsing the Stellaris® Microcontroller Analog-to-Digital Converter (ADC)Application Note Using the Stellaris® Microcontroller Analog-to-Digital Converter (ADC)June 24, 2009 2CopyrightCopyright © 2007–2009 Texas Instruments, Inc. All rights reserved. Stellaris and StellarisWare are registered trademarks of Texas Instruments. ARM and Thumb are registered trademarks, and Cortex is a trademark of ARM Limited. Other names and brands may be claimed as the property of others. Texas Instruments108 Wild Basin, Suite 350Austin, TX 78746Main: +1-512-279-8800Fax: +1-512-279-8879http://www.luminarymicro.comApplication Note Using the Stellaris® Microcontroller Analog-to-Digital Converter (ADC)June 24, 2009 3Table of ContentsIntroduction......................................................................................................................................................... 4Sample Sequencers ........................................................................................................................................... 4Module Configuration Example........................................................................................................................... 5Module Initialization ........................................................................................................................................ 6Sample Sequence Configuration .................................................................................................................... 7Using ADC Interrupts.................................................................................................................................... 10Data Retrieval ............................................................................................................................................... 10Differential Sampling......................................................................................................................................... 11Hardware Averaging Circuit.............................................................................................................................. 15Conclusion........................................................................................................................................................ 16References ....................................................................................................................................................... 16Application Note Using the Stellaris® Microcontroller Analog-to-Digital Converter (ADC)June 24, 2009 4IntroductionStellaris® microcontrollers that are equipped with an analog-to-digital converter (ADC), use an innovative sequence-based sampling architecture designed to be extremely flexible, yet easy to use. This application note describes the sampling architecture of the ADC. Since programmers can configure Stellaris microcontrollers either through the powerful Stellaris Family Driver Library or through direct writes to the device's control registers, this application note describes both methods. The information presented in this document is intended to complement the ADC chapter of the device datasheet, and assumes the reader has a basic understanding of how ADCs function.Sample SequencersMost analog-to-digital converter implementations in 8-,16-, and 32-bit microcontrollers require processor intervention to configure each conversion when the analog input/channel is changed. Stellaris' sequence-based architecture gives software the ability to enable up to four separate sample sequences (encompassing all of the analog input channels) with a single series of configuration writes.The ADC module has a total of four sample sequencers that allow sampling of 1, 4 (there are two 4-beat sequencers), or 8 analog sources with a single-trigger event (see Figure 1). Each sample sequencer has its own set of configuration registers making it completely independent from the other sequencers. All steps in a sample sequence are configurable, allowing software to select the analog input channel (including the temperature sensor), single-ended or differential mode sampling, and whether or not to generate an interrupt after the step completes. The sample sequences also have configurable priority to handle cases where multiple sequences are triggered by the same trigger source or trigger simultaneously.Figure 1. Sample Sequencer StructureA sample sequence can be triggered by various sources, including the processor, timers, analog comparators, PWM unit or GPIO. For situations where multiple sequences have the same trigger source or are triggered simultaneously, the ADC arbitrates execution order based on the configured sequence priorities. When a sample sequence is triggered, it begins sampling at the programmed sampling rate (250K, 500K, or 1M samples/second, depending on the device), iterating through the Step 0Step 1Step 2Step 3Step 4Step 5Step 6Step 7Step 0Sample Sequencer 0 Sample Sequencer 1 Sample Sequencer 2 Sample Sequencer 3Each step can configure:- Analog source (pin or temperature sensor)- Interrupt generation- Single-ended or differential sampling- End of sequenceStep 0Step 1Step 2Step 3Step 0Step 1Step 2Step 3Application Note Using the Stellaris® Microcontroller Analog-to-Digital Converter (ADC)June 24, 2009 5steps of the sequence. Sampling continues until a step has its END bit set, indicating the end of the sequence. The END bit can be set for any step in the sequence, meaning a given sample sequence is not required to collect its maximum number of samples. When the sample sequence completes, the conversion results are stored in the sample sequence FIFO, and can be retrieved by the processor.Module Configuration ExampleTo demonstrate the steps required to configure the ADC, consider the example shown in Figure 2. There are a total of three sensors being monitored, in addition to the on-chip temperature sensor. Since three analog inputs are used, this example assumes the specific Stellaris device has at least three analog inputs. Each sample sequence has its own FIFO with the number of slots equivalent to the size


View Full Document

UT EE 345M - Lecture notes

Download Lecture notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?