4.5 General Purpose Input/Output (GPIO)
2
Electrocardiogram (Ecg) Signals
GPIOs are used for reading an input or setting an output. The GPIOs of the STM32F103RB can all
be used as digital or analog inputs.
Shows a counter on GPIOB.
gpio1
The Electrocardiogram (Ecg)
Reads the inputs of GPIOA and puts them on GPIOB.
gpio2
Pressing buttons S1, S2 move the lit LED. S1 moves the lit LED to the right, S2 to the left.
gpio3
• Ecg: electrical manifestation of heart activity recorded
from the body surface
• monitoring of heart rate
4.5.1 Configuration
The Ecg signal can be recorded fairly easily with surface
The configuration is done with the Settings Wizard (see Chapter
electrodes placed on the limbs and/or the chest, see pages
in Figure 4.1.
below.
GPIOA to GPIOD can be set to different modes:
Input
– Analog: Used to route the signal to an AD converter (see Chapter4.13)
– Floating: Used as a "normal" input
– Input with pull-up / pull-down resister
Output
– Push-pull (max speed 2MHz, 10MHz or 50MHz): Used as a "normal" output
– Open-drain (max speed 2MHz, 10MHz or 50MHz): Used in a system with different
nodes having access to the same wire.
Alternate Function (AF): Used for Oscillator, CAN, JTAG, ADC, Timer, USART, I C and SPI
– Alternate Function push-pull (max speed 2MHz, 10MHz or 50MHz)
– Alternate Function open-drain (max speed 2MHz, 10MHz or 50MHz)
Josef Goette
26
2
Figure 4.1: GPIO Configuration Wizard
4 Peripherals
1 Intro
3.5.2
for more information), shown
6–16
2009
STM32 Cortex-M3 Tutorial
Need help?
Do you have a question about the STM32 Cortex-M3 and is the answer not in the manual?