This information applies to the nRF52840 SoC only.
This example uses the USB CDC ACM module. See the documentation of this module for links to relevant specification documents.
This example shows how to use the CDC ACM USB class, commonly known as Virtual COM port. After connecting the USB cable, the development kit will enumerate as a COMx port on Windows hosts or as a /dev/ttyACMx
device on Linux/Unix hosts. The port can be opened and closed just like a traditional serial port.
For Windows XP/7 hosts, you must manually install the driver that is located in the example directory:
- nordic_cdc_acm_example.inf
Windows 8 (and later) hosts will pick the correct driver (usbser.sys) automatically.
Setup
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\usbd_cdc_acm
LED assignments:
- LED 1 shows the USB bus state:
- ON: State RESUME
- OFF: State SUSPEND
- LED 2 shows the CDC ACM port state:
- ON: Port opened
- OFF: Port closed
- LED 3 shows the CDC ACM RX notification:
- LED 4 shows the CDC ACM TX notification:
Button assignments:
- Button 1 sends a CDC ACM test frame.
- Button 2 sends a CDC ACM line notification.
Testing
Test the USB CDC ACM Example application by performing the following steps:
- Compile and program the application.
- Connect the development kit to the host computer.
- Open the serial port. In your computer's device manager, the development kit will be visible as "nRF52 USB CDC Demo (COMx)".
- Using a terminal emulator, for example putty, send test data from the host computer to the development kit. LED 3 will blink.
- Press Button 1. A test frame will be sent from the development kit. LED 4 state will change. If you are using a terminal emulator, you can see the transmitted data on it as well.