The RS232 communication standard is established back in the ‘60s, but thanks to its implementation on a wide range of devices - including PC motherboards, it gained a lot of popularity and it is still in use. Over time, this standard went through many revisions and the most recent revision is TIA-232-F (R2012). Although it was originally developed to connect teletypewriters and modems, nowadays it is used for serial communication between a wide array of different devices.
To implement the RS232 communication standard on the MCUs, it is necessary to convert the voltage levels to the levels acceptable for the modern MCUs. RS232 2 click performs full RS232 to UART signal conversion, allowing both 3.3V and 5V operation. Additionally, it features ±15 kV ESD protection for the RS-232 I/O pins. These attributes make this click a perfect solution for battery powered, hand-held and portable equipment, PDAs, palmtops, digital cameras, and other devices that still support the RS232 standard.
How does it work?
The integrated circuit used to provide an electrical interface between RS232 and UART on the RS232 2 click is the MAX3237E, a 3V to 5.5V multichannel RS232, 1 Mbit/s line driver/receiver from Texas Instruments. This device allows communication at 1 Mbit/s and allows 5V logic levels, even when working with 3.3V power supply. However, there is an onboard SMD jumper that allows selection of power supply voltage between 3.3V and 5V, if there is a requirement.
The MAX3237E IC consists of five line drivers, three line receivers, and a dual charge pump circuit with ±15 kV pin to pin ESD protection for the serial port I/O pins. Those charge pumps along with the external capacitors, allow the device to run from a single 3V to 5.5V supply, providing the required RS232 voltage levels, which can go up to ±15 V as per standard. The MAX3237E IC generates an RS232 voltage in the range of ±13 V and accepts RS232 signal levels in the range of ±25 V.
To provide the minimal functionality of the UART interface, at least three data lines have to be used: RX line, routed to the mikroBUS™ RX pin (on the click board side), TX line, routed to the mikroBUS™ TX pin (on the click board side), and the GND. Otherwise, this device supports the full stack of RS232 control lines, excluding the Data Set Ready line (DSR). Other relevant RS232 bus lines routed to the mikroBUS™ pins are: Data Terminal Ready (DTR) - routed to the AN pin, Data Carrier Detect (DCD) - routed to the RST pin, Clear To Send (CTS) - routed to the CS pin, Ring Indicator (RI) - routed to the PWM pin, Request To Send (RTS) - routed to the INT pin. All these lines, are actually control lines and are used optionally by the RS232 device.
RS232 2 click features the standardized DE-9 connector for easy connection to the RS232 device. By switching the VCC SEL jumper, it is possible to select the power supply voltage for the RS232 2 click. Although it can work with 5V, the device will accept UART signals of 5V even while working in 3.3V mode.
Specifications
Type | RS232 |
Applications | A perfect solution for battery powered hand-held and portable equipment, PDAs, palmtops, digital cameras, and other devices that still support the RS232 standard. |
On-board modules | MAX3237E, a 3.3V or 5V multichannel RS232, 1 Mbit/s line driver/receiver from Texas Instruments |
Key Features | RS232 2 click allows easy and reliable RS232 to UART communication. It requires 3.3V or 5V for the proper operation and provides RS232 line levels directly, without using any additional components. RS232 I/O pins are ESD protected for up to 15kV. |
Interface | GPIO,UART |
Input Voltage | 3.3V or 5V |
Click board size | L (57.15 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on RS232 2 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
RS232 2 click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Input Voltage Range on RS232 | -25 | +25 | V | |
Output Voltage Range on RS232 | -13 | +13 | V | |
Data Rate | 250 | 1000 | kbps |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - |
Power LED indicator |
JP1 | VCC SEL | Left | Voltage level selection, left position 3.3V, right 5V |
Software support
We provide a library for RS232 2 click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Library Description
This library carries functions for data transmission and reception alongside with functions for individual control of each GPIO pin found on RS232 2 click.
Key functions
uint8_t rs232_2_readByte()
- Reads received byte
void rs232_2_writeByte(uint8_t input)
- Sends byte
uint8_t rs232_2_byteReady()
-Checks for received byte
Examples Description
The application is composed of three sections :
void applicationTask() { // RECEIVER #ifdef __RX__ if (rs232_2_byteReady()) { rec = rs232_2_readByte(); mikrobus_logWrite( &rec, _LOG_BYTE ); } #endif // TRANSMITER #ifdef __TX__ for (tmp = 0; tmp < 9; tmp++) { rs232_2_writeByte( MESSAGE_DATA[tmp] ); } Delay_ms(2000); #endif }
The full application code, and ready to use projects can be found on our LibStock page.
MikroElektronika Libraries used in the example:
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This click board is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.
Downloads
mikroBUS™ standard specifications