Setting up the Adafruit PCA9685 PWM Board with NVIDIA Jetson Xavier NX - Carleton-SRCL/SPOT GitHub Wiki

This guide covers setting up the Adafruit PCA9685 PWM breakout board with the NVIDIA Jetson Xavier NX.

Hardware

The following boards were purchased for use in the laboratory: https://www.adafruit.com/product/815

Installing Required Libraries and Tools

The Linux I2C development library is required for I2C communication in C++. The NVIDIA Jetson should come with this pre-installed, but if not you can run sudo apt-get install libi2c-dev.

Wiring

The PAC9685 uses I2C (Inter-Integrated Circuit) for communication. I2C is a multi-master, multi-slave, single-ended, serial communication bus. It is used for attaching lower-speed peripheral ICs to processors and microcontrollers in short-distance, intra-board communication.

The wire up the board, connect the SDA pin on the Jetson Xavier NX (pin #3) to the SDA pin on the PCA9685 (it should be labelled on the board). Then connect the SDL pin on the Jetson Xavier NX (pin #5) to the SDL pin on the PCA9685 (also labelled). You also need power and a common ground. The PCA9685 is powered by the 3.3V pin on the Jetson Xavier NX (pin #1), which goes to the VCC pin on the PCA9685. Do not connect the 3.3V pin to the V+ pin on the PCA9685 - the board will not power on. The ground connection is irrelevant, any ground pin available on the Jetson Xavier NX can be used. Currently, we use pin #6 as the common ground.

If you want to switch from using software PWM, you will also need to wire up the thrusters to the PCA9685. On the SPOT lower deck, there should be a breadboard containing transistors. There should be a cable bundle going from the lower deck to the middle deck, which should contain the thruster connectors. The color of the connections are consistent across all three platforms, and are:

  • Thruster #1 - Yellow
  • Thruster #2 - White
  • Thruster #3 - Brown
  • Thruster #4 - Red
  • Thruster #5 - Black
  • Thruster #6 - Blue
  • Thruster #7 - Green
  • Thruster #8 - Orange
  • Pucks - Purple

Connect them in sequential order to the signal pins for channels 0-7 of the PCA9685, as shown:

You should now be able to power up a platform, and a green LED should illuminate on the PCA9685 to indicate the chipset is receiving power.

Testing Communication

Testing communication with the PCA9685 can be done via command line on the NVIDIA Jetson Xavier NX. The simplest way to access the command line is by remoting in via SSH. Once you have access to the command line, enter the command sudo i2cdetect -y -r 8. If the board is visible over I2C, the output from that command should look like the image below, which shouw the PCA is at address 0X40.

The board is now ready to be used in the SPOT software! Note that this board does not only need to be used for thrusters - anything that can be controlled using PWM can be connected to the board.