12
EasyPIC6 Development System
MikroElektronika
page
6.0. RS-232 Communication Interface
RS-232
serial communication is performed through a 9-pin SUB-D connector and the microcontroller USART module. In order to enable
such communication, it is necessary to establish a connection between RX and TX communication lines (
KDQGVKDNLQJ
lines CTS and
RTS are optionally used) and microcontroller pins provided with USART module using a DIP switch. The microcontroller pins used in such
communication are marked as follows: RX -
UHFHLYHGDWD
, TX -
WUDQVPLWGDWD
, CTS -
FOHDUWRVHQG
and RTS -
UHTXHVWWRVHQG
. Baud rate
goes up to 115kbps.
The USART (universal synchronous/asynchronous receiver/transmitter) is one of the most common ways of exchanging data between the
PC and peripheral components. In order to enable the USART module of the microcontroller to receive input signals with different voltage
levels, it is necessary to provide a voltage level converter such as MAX-202C.
!"
PICxxxx
OSC2
RC0
RC1
RC2
RC3
RD0
RD1
OSC1
GND
GND
RD7
RD6
RD5
RD4
RC7
RC6
RC5
RC4
RD3
RD2
VCC
MCLR
RA0
RA1
RA2
RA3
RA4
RA5
RE0
RE1
RE2
VCC
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
DIP40
R54
1K
R3
1K
MAX202
1
6
5
9
Bottom view
SUB-D 9p
Figure 6-2
: RS-232 module schematic
6:5;&76 21
6:7;576 21
127(
Make sure that your microcontroller is provided with the USART module as it is not necessarily integrated in all microcontrollers.
The function of DIP switches SW7 and SW8 is to determine which of the microcontroller pins are to be used as RX and TX lines. The
microcontroller pinout varies depending on the type of the microcontroller. Figure 6-2 shows the microcontroller in DIP40 package
(PIC16F887).
Figure 6-1
: RS-232 module
RS-232 connector