RS232 Click Board
RS232 Click Board
The RS232 Click Board™ provides an interface between the TTL/CMOS logic levels commonly used on microcontrollers and the RS-232 bus. RS-232 is a rather old communication protocol that has survived thanks to its robustness and implementation on many personal computer motherboards. It can still be found on various pieces of DTE and DCE equipment. This Click Board™ allows standard type MCUs to communicate through the RS-232 interface via the standard UART bus pins: RX and TX.
The RS232 Click Board™ utilizes the MAX3232, a 3.0V to 5.5V low power, true RS-232 transceiver, from Maxim Integrated. This device can achieve communication speed up to 232 kbps (EIA/TIA-232).
Software Support
We provide a library for the RS232 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 provides generic functions for working with the Click board™.
Key Functions
void rs232_writeByte(uint8_t input)
- Writes a Single Byte.uint8_t rs232_readByte()
- Reads a Single Byte.uint8_t ras232_byteReady()
- Checks if a new byte has been received.
Example Description
The application is composed of three sections:
- System Initialization - Initializes UART module.
- Application Initialization - Driver intialization.
- Application Task - (code snippet) - Checks if new data byte has received in the 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() { char tmp; uint8_t rdyFlag; // RECEIVER - UART polling rdyFlag = rs232_byteReady(); if (1 == rdyFlag) { tmp = rs232_readByte(); mikrobus_logWrite( &tmp, _LOG_BYTE ); } // TRANSMITTER - TX each 2 sec /* for (tmp = 0; tmp < 9; tmp++) { rs232_writeByte( MESSAGE_DATA[tmp] ); mikrobus_logWrite( "MESSAGE SENT", _LOG_LINE ); } Delay_ms(2000); */ }
The full application code, and ready to use projects can be found on our Libstock page.
Other mikroE Libraries used in the example:
- UART
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
The RS232 Click Board™ is supported by 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 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.