Enhance the longevity and reliability of your devices by implementing our USB isolation solution, which shields them from power fluctuations
A
A
Hardware Overview
How does it work?
USB UART 2 Click is based on the ADUM4160, a USB port isolator from Analog Devices. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over UART interface, with additional functionality provided the following pins on the mikroBUS™ line: RST, CS, PWM, INT. Use the USB UART 2 click for isolating USB communication, and preventing voltage spikes from destroying sensitive equipment. The ADUM4160BRWZ is a USB port isolator, based on Analog Devices, iCoupler® technology. Combining high-speed CMOS and
monolithic air core transformer technology, these isolation components provide outstanding performance characteristics and are easily integrated with low and full speed USB-compatible peripheral devices. The ADUM4160BRWZ uses the edge detection based iCoupler technology in conjunction with internal logic to implement a transparent, easily configured, upstream facing port isolator. Isolating an upstream facing port provides several advantages in simplicity, power management, and robust operation. The click takes power both from
the development system and from the USB, so both sides of the isolator can function. The FT232RL chip on board to act as a USB-UART converter. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VIO SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Features overview
Development board
Clicker 2 for PIC32MX is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit MIPS M4K core PIC32 microcontroller, the PIC32MX460F512L from Microchip, two mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a mikroProg programmer connector, and two 26-pin headers for interfacing with external electronics. Its compact design with clear and easily recognizable silkscreen markings allows you to build gadgets with unique functionalities and features quickly. Each part of
the Clicker 2 for PIC32MX development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the Clicker 2 for PIC32MX programming method, using a USB HID mikroBootloader, an external mikroProg connector for PIC32MX programmer, or through an external ICD2/3 programmer, the Clicker 2 board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Mini-B cable, where onboard voltage regulators provide the appropriate voltage levels to each component on the board or using a Li-Polymer battery via an
onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several user-configurable buttons and LED indicators. Clicker 2 for PIC32MX is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC32
MCU Memory (KB)
512
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
32768
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic
Step by step
Project assembly
Track your results in real time
Application Output
This Click board can be interfaced and monitored in two ways:
Application Output
- Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
UART Terminal
- Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Software Support
Library Description
This library contains API for USB UART 2 Click driver.
Key functions:
usbuart2_pwr_ctrl
- This function sets the click turns click on.usbuart2_set_cts
- This function sets CTS pin.usbuart2_send_command
- This function is used for sending commands.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief USB UART 2 Click Example.
*
* # Description
* This example reads and processes data from USB UART 2 clicks.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes driver and power module.
*
* ## Application Task
* Reads data and echos it back to device and logs it to board.
*
* @author Stefan Ilic
*
*/
#include "board.h"
#include "log.h"
#include "usbuart2.h"
#include "string.h"
#define PROCESS_BUFFER_SIZE 500
static usbuart2_t usbuart2;
static log_t logger;
static char app_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
static int32_t app_buf_len = 0;
void application_init ( void ) {
log_cfg_t log_cfg; /**< Logger config object. */
usbuart2_cfg_t usbuart2_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
Delay_ms( 100 );
// Click initialization.
usbuart2_cfg_setup( &usbuart2_cfg );
USBUART2_MAP_MIKROBUS( usbuart2_cfg, MIKROBUS_1 );
err_t init_flag = usbuart2_init( &usbuart2, &usbuart2_cfg );
if ( UART_ERROR == init_flag ) {
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
app_buf_len = 0;
usbuart2_pwr_ctrl( &usbuart2, USBUART2_POWER_ON );
usbuart2_set_cts( &usbuart2, USBUART2_CTS_NO_ACTIVE );
usbuart2_set_mode( &usbuart2, USBUART2_MODE_NORMAL );
log_info( &logger, " Application Task " );
}
void application_task ( void ) {
app_buf_len = usbuart2_generic_read( &usbuart2, app_buf, PROCESS_BUFFER_SIZE );
if ( app_buf_len > 0 ) {
log_printf( &logger, "%s", app_buf );
memset( app_buf, 0, PROCESS_BUFFER_SIZE );
}
}
void main ( void ) {
application_init( );
for ( ; ; ) {
application_task( );
}
}
// ------------------------------------------------------------------------ END