4.6 Serial Interface (USART)
Read Data
Copy the files
serial.c
while ( ! ( USARTx
r e c e i v e d
yourCharacter = (USARTx DR & 0 x1FF ) ;
4.6.3 Using Interrupts
Configuration
The configuration is done with the Settings Wizard shown in Figure 4.4. The function
void USART2 IRQHandler (void)
occurs. Refer to the example usartIrq1 for more information.
4.6.4 Driver
The data are transmitted on the system voltage level
2
RS232 level
. The RS232 interface can then be connected to any PC. For a minimum communica-
tion three wires are required:
TxD: Tranceive Data
RxD: Receive Data
GND: Common Ground
Figure
4.5
shows the driver included in the STM32F103RB .
1
System voltage: +3.3V (=HIGH) and 0V (= LOW)
2
RS232 level: +12V (=LOW = 0) and -12V (= HIGH = 1)
Lukas Kohler
and
serial.h
Listing 4.7: Receive Data
SR & USART FLAG RXNE) ) ;
is called when an interrupt, configured in the Settings Wizard,
Figure 4.4: USART Configuration Wizard (using Interrupts)
and use the function
// wait u n t i l a char has been
// read c h a r a c t e r from t h e b u f f e r
1
to the converter and there converted to the
2
int ser getchar (void)
The Electrocardiogram
electrodes placed on the l
below.
Josef Goette
Electrocardio
.
• Ecg: electrical ma
from the body surfa
• monitoring of heart
The Ecg signal can b
29
Need help?
Do you have a question about the STM32 Cortex-M3 and is the answer not in the manual?