UART via RS-232
The
UART
(universal asynchronous receiver/
transmitter) is one of the most common ways of
exchanging data between the MCU and peripheral
components. It is a serial protocol with separate
transmit and receive lines, and can be used for full-
duplex communication. Both sides must be initialized
with the same baudrate, otherwise the data will not be
received correctly.
RS-232 serial communication
is performed through a 9-pin
SUB-D connector and the microcontroller UART module. In
order to enable this communication, it is necessary
to establish a connection between
RX
and
TX
lines on SUB-D connector and the same pins on
the target microcontroller using DIP switches.
Since RS-232 communication voltage levels
are different than microcontroller logic
levels, it is necessary to use a RS-
232 Transceiver circuit, such as
MAX3232
as shown on
Figure 8-1
.
D
AT
A BUS
Figure 8-1: RS-232 connection schematics
Enabling RS-232
In order to enable RS-232
communication, you must push
SW5.3
(RG1) and
SW5.4
(RG2)
to
ON
position. This connects the
RX
and
TX
lines to appropriate
microcontroller pins and its second
UART module.
communica
tion
page 22
Easy
PIC PRO
v7
Summary of Contents for EasyPIC PRO v7
Page 37: ...page 37 EasyPIC PROv7 notes...
Page 38: ...page 38 EasyPIC PROv7 notes...