Zakładka z wyszukiwarką danych komponentów
  Polish  ▼
ALLDATASHEET.PL

X  

AN2979 Arkusz danych(PDF) 3 Page - STMicroelectronics

Numer części AN2979
Szczegółowy opis  Implementing a simple ADC using the STM8L101xx comparator
PDF  12 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Producent  STMICROELECTRONICS [STMicroelectronics]
Strona internetowa  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2979 Arkusz danych(HTML) 3 Page - STMicroelectronics

  AN2979 Datasheet HTML 1Page - STMicroelectronics AN2979 Datasheet HTML 2Page - STMicroelectronics AN2979 Datasheet HTML 3Page - STMicroelectronics AN2979 Datasheet HTML 4Page - STMicroelectronics AN2979 Datasheet HTML 5Page - STMicroelectronics AN2979 Datasheet HTML 6Page - STMicroelectronics AN2979 Datasheet HTML 7Page - STMicroelectronics AN2979 Datasheet HTML 8Page - STMicroelectronics AN2979 Datasheet HTML 9Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 3 / 12 page
background image
AN2979
Application description
Doc ID 15651 Rev 1
3/12
1
Application description
1.1
Comparator features
The STM8L101xx microcontroller embeds two zero-crossing comparators sharing the same
current bias and the same voltage reference.
This voltage reference can be:
●
internal (comparison to ground)
●
or external (comparison to a reference pin voltage)
Each comparator is connected to 4 channels which can be used to generate an interrupt, a
timer input capture or a timer break. Their polarity can be inverted.
Note:
For external comparison be aware that the STM8L101xx comparator maximum input value
is VDD -1.25 V with VDDmax = 3.6 V
1.2
ADC implementation
Each comparator can be used to implement an ADC. This technique is based on a simple
principle: the signal to be measured is connected to the non-inverted input and the
reference signal is an external signal connected to the inverting input.
In the demonstration software, the comparator used is COMP2 and the channel used as the
signal to be measured is the channel 3 (pin PD2).
The reference signal is generated by charging a capacitor through a resistor. While the
voltage across the capacitor is being charged, it follows an exponential curve.
This exponential equation has been implemented in the software. The time taken by the
capacitor voltage to rise above the voltage value to be converted is used in the charge
equation to retrieve the digital conversion value.
Charge equation:
Where:
●
Vmeas is the value to be mesaured
●
VDD is the input voltage
●
t is the time measured by timer2 when the comparator detects that the input voltage is
above the reference voltage
●
T is the RC constant (here R=10 k
Ω and C=100 nF so T= 1 ms)
The capacitor is charged and discharged using the timer 2 PWM on channel1/ PB0.
A timer is programmed to generate a 2 ms PWM with a duty cycle of 0.25. This 2-ms period
permits an ADC implementation using the full voltage range that the comparator tolerates.
The capacitor charging curve is shown in the following figure.
V
meas
V
DD
1
t
T
---
–
⎝⎠
⎛⎞
exp
–
⎝⎠
⎛⎞
×
=



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12


Arkusz danych Pobierz

Go To PDF Page


Link URL



Czy Alldatasheet okazała się pomocna?  [ DONATE ] 

O Alldatasheet   |   Reklama   |   Kontakt   |   Polityka prywatności   |   Link do karty katalogowej    |   Linki   |   Lista producentów
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