Search Results for: an00181

USB CDC Class as Virtual Serial Port – Extended on xCORE-200 Explorer

USB CDC Class as Virtual Serial Port – Extended on xCORE-200 Explorer

This application note shows how to create a USB device compliant to
the standard USB Communications Device Class (CDC) on an XMOS multicore microcontroller.

The code associated with this application note provides an example of
using the XMOS USB Device Library (XUD) and associated USB class descriptors
to provide a framework for the creation of a USB CDC device that implements
Abstract Control Model (ACM).

This example USB CDC ACM implementation provides a Virtual Serial port
running over high speed USB. The Virtual Serial port supports the
standard requests associated with ACM model of the class.

A serial terminal program from host PC connects to virtual serial port and
interacts with the application. The application provides a menu to toggle
on-board LEDs, read an I2C device, monitor buttons and loopback characters.
This application demo code demonstrates a simple way in which USB CDC class
devices can easily be deployed using an xCORE-200 device.

Note: This application note provides a standard USB CDC class device and as a
result does not require external drivers to run on Windows, Mac or Linux.

This application note extends AN00124 to provide a virtual serial port
application that interfaces to hardware demostrating how to build a system
which allows a USB host to connect to custom hardware using an XMOS device.

Required tools and libraries

  • xTIMEcomposer Tools – Version 14.0.0
  • XMOS USB library – Version 3.1.0
  • XMOS I2C library – Version 2.0.0

Required hardware

This application note is designed to run on an XMOS xCORE-200 series device.

The example code provided with the application has been implemented and tested
on the xCORE-200 explorerKIT but there is no dependancy on this board
and it can be modified to run on any development board which uses an xCORE-USB series device.

Prerequisites

  • This document assumes familiarity with the XMOS xCORE architecture, the Universal Serial Bus 2.0 Specification and related specifications, the XMOS tool chain and the xC language. Documentation related to these aspects which are not specific to this application note are linked to in the references appendix.
  • For descriptions of XMOS related terms found in this document please see the XMOS Glossary [1]
    .
  • For the full API listing of the XMOS USB Device (XUD) Library please see the document XMOS USB Device (XUD) Library [2]
    .
  • For information on designing USB devices using the XUD library please see the XMOS USB Device Design Guide for reference [3]
    .
  • For information on the USB CDC class using the XMOS USB library see AN00124
  • For information on using the xCORE-200 explorerKIT accelerometer see AN00181
[1]

http://1m2n3b4v.xmos.com/published/glossary

[2]

http://1m2n3b4v.xmos.com/published/xuddg

[3]

http://1m2n3b4v.xmos.com/published/xmos-usb-device-design-guide

USB HID Class – Extended on xCORE-200 Explorer

USB HID Class – Extended on xCORE-200 Explorer

This application note shows how to create a USB device compliant to
the standard USB Human Interface Device (HID) class on an XMOS multicore
microcontroller.

The code associated with this application note provides an enhancement
to AN00129 for extending the USB HID device to interface with hardware
which can provide input for a USB mouse.

This example uses the ADC on the XMOS xCORE-USB device to interface to
a mixed signal sliceCARD and provide a joystick interface which allows
the USB HID to be controlled.

The application operates as a simple mouse which when running moves the mouse
pointer on the host machine. This demonstrates the simple way in which PC
peripheral devices can easily be deployed using an xCORE device.

Note: This application note provides a standard USB HID class device and as a
result does not require drivers to run on Windows, Mac or Linux.

This application note describes extending XMOS application note AN00129
for the xCORE-200 explorerKIT platform. The demo application is extended
using the functionality described in AN00181 for accesing the accelerometer
on the xCORE-200 explorerKIT.

Required tools and libraries

  • xTIMEcomposer Tools – Version 14.0.0
  • XMOS USB library – Version 3.1.0
  • XMOS I2C library – Version 2.0.0

Required hardware

This application note is designed to run on an XMOS xCORE-200 series device.

The example code provided with the application has been implemented and tested
on the xCORE-200 explorerKIT but there is no dependancy on this board
and it can be modified to run on any development board which uses an xCORE-200
series device.

Prerequisites

  • This document assumes familiarity with the XMOS xCORE architecture, the
    Universal Serial Bus 2.0 Specification (and related specifications, the
    XMOS tool chain and the xC language. Documentation related to these aspects
    which are not specific to this application note are linked to in the references
    in the appendix.
  • For descriptions of XMOS related terms found in this document please see
    the XMOS Glossary [1]
    .
  • Application notes AN00129 (USB HID) and AN00181 (Accelerometer)
  • For the full API listing of the XMOS USB Device (XUD) Library please see
    thedocument XMOS USB Device (XUD) Library [2]
    .
  • For information on designing USB devices using the XUD library please
    see the XMOS USB Device Design Guide for reference [3]
    .
[1]

http://1m2n3b4v.xmos.com/published/glossary

[2]

http://1m2n3b4v.xmos.com/published/xuddg

[3]

http://1m2n3b4v.xmos.com/published/xmos-usb-device-design-guide

I2C Library

I2C Library

A software defined, industry-standard, I2C library
that allows you to control an I2C bus via xCORE ports.
I2C is a two-wire hardware serial
interface, first developed by Philips. The components in the libary
are controlled via C using the XMOS multicore extensions (xC) and
can either act as I2C master or slave.

The libary is compatible with multiple slave devices existing on the same
bus. The I2C master component can be used by multiple tasks within
the xCORE device (each addressing the same or different slave devices).

Features

  • I2C master and I2C slave modes.
  • Supports speed up to 400 Kb/s.
  • Clock stretching suppoirt.
  • Synchronous and asynchronous APIs for efficient usage of processing cores.

Typical Resource Usage

This following table shows typical resource usage in some different configurations. Exact resource usage will depend on the particular use of the library by the application.

Configuration

Pins

Ports

Clocks

Ram

Logical cores

Master

2

2 (1-bit)

0

~1.1K

0

Master (single port)

2

1 (multi-bit)

0

~0.9K

0

Master (asynchronous)

2

2 (1-bit)

0

~3.1K

1

Master (asynchronous, combinable)

2

2 (1-bit)

0

~2.9K

≤ 1

Slave

2

2 (1-bit)

0

~1.4K

≤ 1

Software version and dependencies

This document pertains to version 3.1.4 of this library. It is known to work on
version 14.2.0 of the xTIMEcomposer tools suite, it may work on other versions.

This library depends on the following other libraries:

  • lib_logging (>=2.0.0)
  • lib_xassert (>=2.0.0)

The following application notes use this library:

  • AN00181 – xCORE-200 explorer accelerometer demo
Scroll to Top