4.13 Analog to Digital Converter (ADC)
Hour
Table 4.1: Configuration of the register RTC CNTL and RTC CNTH
void RTC IRQHandler ( void )
45
i f (RTC
CRL & (1
RTC
CRL &= ˜(1
// your code
50
i f (RTC
CRL & (1
RTC
CRL &= ˜(1
// your code
55
i f (RTC
CRL & (1
RTC
CRL &= ˜(1
// your code
// end RTC IRQHandler
60
4.13 Analog to Digital Converter (ADC)
reads the values and writes them on the serial interface (115200Baud)
ad1
4.13.1 Conversion Modes
The AD converters of the STM32F103RB can operate in two different modes:
Singleshot: The program triggers to read the value once.
Scan Mode: In scan mode, automatic conversion is performed on a selected group of analog
inputs.
STM32F103RB have two 12-bit Analog to Digital Converters which share up to 16 external chan-
nels. Additional logic functions embedded in the ADC interface allow:
Simultaneous sample and hold
Interleaved sample and hold
Single shot
The ADC can be served by the DMA controller. An analog watchdog feature allows very pre-
cise monitoring of the converted voltage of one, some or all selected channels. An interrupt is
generated when the converted voltage is outside the programmed thresholds.
Lukas Kohler
Minute
Second
00
00
01
00
01
01
23
00
01
Listing 4.9: RTC ISR
0) )
0) ;
1) )
1) ;
2) )
2) ;
RTC CNTH
RTC CNTL
0x0000
0x0001
0x0000
0x003D
0x0001
0x4371
// check second f l a g
// c l e a r second f l a g
// check alarm f l a g
// c l e a r alarm f l a g
// check Overflow f l a g
// c l e a r Overflow f l a g
Seconds
1s
2
Electrocardio
3601s
82801
The Electrocardiogram
• Ecg: electrical ma
from the body surfa
• monitoring of heart
The Ecg signal can b
electrodes placed on the l
below.
Josef Goette
37
Need help?
Do you have a question about the STM32 Cortex-M3 and is the answer not in the manual?