ClearCore Library
Loading...
Searching...
No Matches
ClearCore USB Port

Overview

The USB port on the ClearCore interfaces directly with the USB native support of the ATSAMEN19A processor.

This configuration removes the need for a seperate USB serial port chip and provides versatility in how the device is presented to the USB host computer. It also means that since the main processor is providing the USB support, the USB device will go away and come back as the ClearCore is powered down or reset. Since the port goes away during resets, applications that interface with the USB port should watch for port removals to avoid holding open a stale instance of the COM port.

Windows Drivers

Windows drivers for the ClearCore USB port are downloadable from http://www.teknic.com/downloads. Windows 10 users are not required to install the driver, but it is helpful so that the ClearCore USB device appears as "Teknic ClearCore (COMxx)" instead of "USB Serial Device (COMxx)" in Device Manager.

Application Operation

During application operation, the USB port is presented as a serial device. Windows users will find the device listed in the Ports (COM & LPT) section of Device Manager.

From the ClearCore application, use the ConnectorUsb object to interact with the USB port serial device.

// Open the USB serial port on the device side
// Wait for the host to open the USB serial port
while (!ConnectorUsb) {
continue;
}
ConnectorUsb.SendLine("Serial is now connected and host is listening.");
bool SendLine()
Send carriage return and newline characters.
Definition ISerial.h:162
void PortOpen() override
SerialUsb ConnectorUsb
USB connector instance.

Bootloader Operation

ClearCore ships with a UF2 bootloader installed. During bootloader operation, the USB port is presented as a serial device, HID device and a Mass Storage device. This allows the device to be reprogrammed in a variety of methods that only require a USB cable.

Note
The Application and Bootloader USB devices enumerate as different product IDs, and thus will show up as different COM ports. This allows the operation mode to be clearly identified and use different capabilities based on the mode.
As the ClearCore switches between the application COM port and the bootloader COM port, make sure you have the proper port selected.

See UF2 Bootloader for more details on the bootloader operation and flashing firmware.