RS232 2 Click Board
RS232 2 Click Board
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. The RS232 2 Click Board™ 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 the RS232 2 Click Board™ a perfect solution for battery-powered, hand-held and portable equipment, PDAs, palmtops, digital cameras, and other devices that still support the RS-232 standard.
Software Support
We provide a library for the RS232 2 Click Board™ 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 the RS232 2 Click Board™.
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 :
- System Initialization - Initializes RST, CS, PWM pin as OUTPUT and INT, AN pin as INPUT and UART module Application Initialization - Driver initialization
- Application Task - (code snippet) - Checks if new data byte has been received in RX buffer (ready for reading),
and if ready than reads one byte from the RX buffer. In second case application task writes message data via UART.
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:
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a 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
The RS232 2 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.
RS232 2 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.