Electronic Components Datasheet Search
  English  ▼

X  

AN2658 Datasheet(PDF) 13 Page - STMicroelectronics

Part # AN2658
Description  Using the analog to digital converter of the STM8S microcontroller
PDF  23 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2658 Datasheet(HTML) 13 Page - STMicroelectronics

Back Button AN2658 Datasheet HTML 9Page - STMicroelectronics AN2658 Datasheet HTML 10Page - STMicroelectronics AN2658 Datasheet HTML 11Page - STMicroelectronics AN2658 Datasheet HTML 12Page - STMicroelectronics AN2658 Datasheet HTML 13Page - STMicroelectronics AN2658 Datasheet HTML 14Page - STMicroelectronics AN2658 Datasheet HTML 15Page - STMicroelectronics AN2658 Datasheet HTML 16Page - STMicroelectronics AN2658 Datasheet HTML 17Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 13 / 23 page
background image
AN2658
Configuring ADC registers for conversion
Doc ID 14152 Rev 2
13/23
ADC_DBx (if DBUF bit is set) from which they must be retrieved before they are overwritten
by the next set of conversions (especially if continuous mode is also selected).
Register settings:
ADC_CR2: SCAN bit
ADC_CR3: DBUF = 0 or 1 (data buffer registers “not used” or “used”)
Practical use: To collect a set of analog values from different inputs in one shot (for
example to read a sample of several AC voltage waveforms almost simultaneously).
3.2
Conversion speed selection
The total conversion speed of an ADC depends proportionally on the ADC clock frequency,
the sampling time duration and on the ADC resolution. The ADC clock speed must be
selected by selecting the division factor to be applied to the internal master clock. The
sampling time is not customizable and depends on the ADC clock (3 ADC clocks).
Register settings:
ADC_CR1: SPSEL[2:0] bits
3.3
Analog input selection
The device has up to 16 external analog inputs connected to GPIO input pins. Pins to be
used as ADC input function must be configured as floating inputs and the input Schmitt
triggers on these pins should be disabled to avoid unnecessary power consumption. If the
application changes the analog input channel during conversion then the current conversion
is stopped and the next conversion starts on the new channel.
If scan mode is selected then the channel bits define the top channel in the scan sequence
(from channel 1 to the top channel).
Register settings:
ADC_CSR: CH[3:0] bits
3.4
Storing converted values
The converted ADC value is stored in the ADC_DRH and ADC_DRL registers. If buffered
mode is selected then data are stored cyclically in the data buffer registers ADC_DBxRH
and ADC_DBxRL (x= 0..N, N is device dependent, refer to the datasheet).
Because the converted value has a 10 bit length and the data registers have 2x8 bit length,
it is possible to select left or right alignment of the conversion result in the data registers. In
left alignment the 8 most significant bits are stored in a single register, in right alignment the
8 least significant bits are stored in a single register. This can be chosen to suit the
application. Data register reading is buffered - when the first register is read, the second
register is automatically stored in a shadow register to be read later. This prevents reading
data register values from 2 different conversions.
The first register to be read depends on the data alignment. You must read the MSB first in
left alignment mode and read LSB first in right alignment mode.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com