USB UART 4 click offers a USB to asynchronous serial data (UART) interface, allowing the microcontroller based designs to communicate with the personal computer, in a very simple way. It is equipped with the FT232RL, a very popular USB to UART interface IC, used on many MikroElektronika devices – both for its reliability and simplicity. USB UART click is used for whenever there is a need to seamlessly and effortlessly interface the UART lines to a personal computer. It can be used with any UART terminal, like the one found in MikroElektronika compilers.
How does it work?
Like already mentioned, USB UART click carries the FT232RL, a USB to UART interface IC, from FTDI. The entire USB protocol is handled on the IC itself, thus no USB specific firmware programming is required. FTDI provides royalty-free Virtual Com Port (VCP) and Direct (D2XX) drivers for all the major OSes, used on personal computers. FT232RL also contains an integrated 1024 Bit internal EEPROM for storing USB VID, PID, serial number, product description strings and CBUS I/O configuration.
The Baud Rate Generator provides a 16x clock input to the UART Controller from the 48MHz reference clock. It consists of a 14-bit pre-scaler and 3 register bits which provide fine tuning of the baud rate – used to divide by a number plus a fraction. This determines the baud rate of the UART, which is programmable from 183 baud to 3 Mbaud. Also, non-standard baud rates are supported. The baud rate is automatically calculated by the FTDI driver, so it is enough to simply forward the desired baud rate to the driver, usually done by selecting the baud rate via the GUI interface of the PC terminal application.
After installing the OS drivers, the device is ready to be used. When plugged in, it will create a virtual COM port. After that, it can be used with the USART Terminal application, included in every mikroE compiler. It can be used for the data exchange between the MCU and the host computer. More information about working with the UART communication, in general, can be found in the following Learn article.
This device also features the configurable CBUS pins, which can be used for several different useful functions, as for example – configurable clock out for driving the microcontroller, data LED drive, USB Sleep, PWR status and so on. By default, CBUS3 and CBUS4 pins are configured as Power Enable and Sleep options and are routed to the PWM and RST pins of the mikroBUS™, respectively. More information about configuring the CBUS pins can be found in the FT232RL datasheet.
CBUS3 output pin (PWM pin of the mikroBUS™) will be set to a LOW logic state during the USB suspend mode It can be used to power down external circuitry or be used for similar purposes.
CBUS4 output pin (RST pin of the mikroBUS™) will be set to a LOW logic state after the device has been configured by the USB, then HIGH during the USB suspend mode. This can also be used for the powering down/power saving, by turning unneeded external circuitry.
This device also supports two additional signals – RTS (Request To Send) and CTS (Clear To Send), which can be used when the hardware flow control is required.
USB UART click also features a small low noise LDO, used to provide the logic voltage level reference. The input voltage for the LDO is taken from the USB or the mikroBUS™ 5V rail. The 3.3V rail from the LDO output is routed to the SMD jumper. It allows selection of the referent voltage for the logic section of the FT232RL, thus making possible to interface the USB UART click to both 3.3V and 5V MCUs.
The UART communication is indicated by two LEDs, red for TX (sending data in UART to USB direction) and yellow for RX (receiving data in USB to UART direction). These LEDs are used to provide a visual indication if there is any data transfer ongoing.
One feature worth mentioning is this Click board™ specific shape – it is made so that it can be plugged directly into the USB Type A port. It doesn’t have a conventional USB connector, but the PCB is shaped so that the USB traces can be connected to the USB port. Since the FT232RL supports the unique serial number feature, this makes it handy for developing data protection devices and dongles of various kinds. However, it can also be used in a traditional way.
Specifications
Type
USB
Applications
Useful whenever a simple and ready-made solution for interfacing USB to UART is needed, for a wide range of applications.
On-board modules
FT232RL USB-to-UART interface module from FDTI
Key Features
Integrated support for the USB protocol, no need to develop dedicated firmware for handling the USB to UART communication, CBUS programmable pins, unique serial number programmed in OTP memory.
Interface
UART,USB
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on USB UART 4 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | RX LED | – | Data Receive(RX) status LED |
LD2 | TX LED | – | Data Send (TX) status LED |
LD3 | PWR | – | Power LED indicator |
JP1 | – | Left | Logic voltage level selection jumper, left position 3.3V, right position 5V |
Software Support
We provide a library for the USB UART 4 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for USB UART 4 Click driver.
Key functions
-
usbuart4_pwr_ctrl
This function sets the click turns click on. -
usbuart4_set_cts
This function sets CTS pin. -
usbuart4_send_command
This function is used for sending commands.
Example Description
This example reads and processes data from USB UART 4 clicks.
void application_task ( void ) {
app_buf_len = usbuart4_generic_read( &usbuart4, app_buf, PROCESS_BUFFER_SIZE );
if ( app_buf_len > 0 ) {
log_printf( &logger, "%s", app_buf );
memset( app_buf, 0, PROCESS_BUFFER_SIZE );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.USBUART4
Additional notes and informations
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.