5 Buttons and LEDs

Digital Addressable LEDs, RGB LED, LED Row, Joystick, Tactile- and Touch Buttons.

Digital Addressable LEDsRGB LEDLED Row and I/O Expander 1Buttons, Joystick and I/O Expander 2Touch ControllerStandalone Touch Button

5.1 Digital Addressable LEDs

The Explorer features eight serially addressable RGB LEDs. These LEDs behave similarly to WS2812B LEDs. Comparator U301 (MCP6561) connects the control signal from the CNANO socket and acts as a logic-level translator.
  • Extend the LED strip using pin header J303
  • Select power source using pin header J316
  • Supply external power through pin header J302
Tip: The LED strip input is available through the pin header footprint J313.
Figure 5-1. Addressable LED Circuit
Remapping AreaBoard Overview
Important: Long LED strips consume a lot of current, and it is recommended to use an external supply to power LED strips attached to the board.
Tip: Check out the PIC® and AVR® examples for driving WS2812 or similar LEDs on MPLAB® Discover.

Related information: 10.2 Addressable LEDs Timing and Format.

5.2 RGB LED

An RGB LED is connected to the PWM outputs from the CNANO socket.
CAUTION: The LED is very bright when driven at full power - do not stare at it.
The PWM outputs from the CNANO socket are shared between the servomotor driver and the mikroBUS socket. Disconnect the different channels by removing the jumper caps from J203 and J309.
  • Pin header J309 connects the RGB LED to the CNANO socket
  • Pin header J203 connects the mikroBUS PWM channel to the CNANO socket
Figure 5-2. RGB LED Overview
Board OverviewRemapping AreaMBUSServo-Motor Headers
Tip: Check out the PIC and AVR examples for driving RGB LEDs on MPLAB Discover.

5.3 LED Row and I/O Expander 1

LED Row

The Explorer features eight controllable yellow LEDs. Turn the LED on by pulling the pin low (active-low).

The eight LEDs can be controlled in three different ways:
  1. From the Remapping Area.
  2. From I/O Expander 1 via the I2C Bus.
  3. From the 1x8 pin header (J301).

I/O Expander 1

Configure the GP pin as output and low to turn on an LED with the I/O Expander.
Info: Each LED is connected to a resistor network, ensuring that there are no short circuits if controlled from multiple sides at once.
Figure 5-3. LED Row Connections
Board OverviewRemapping AreaI2C Bus
Info: I/O Expander 1’s 7-bit I2C address: 0x25.

5.4 Buttons, Joystick and I/O Expander 2

Tactile and Touch Buttons

Three tactile and three touch buttons are available as user inputs on the Explorer. The buttons are connected in a group of one LED, one tactile, and one touch button. The grouping is shown on the silkscreen. Pressing any button in the same group will assert the same signal and activate the LED.

The button signals can be accessed in three different ways:
  1. From the Remapping Area.
  2. From I/O Expander 2 via the I2C Bus.
  3. From the 1x8 pin header (J401).
Tip: See section 5.5 Touch Controller for more information on the touch buttons.

Joystick

The joystick signals can be accessed in two different ways:
  1. From I/O Expander 2 via the I2C Bus.
  2. From the 1x8 pin header (J401).

I/O Expander 2

Configure the GP pins as inputs with internal pull-ups to read the button states with the I/O Expander.
Info: Each button signal is connected to a resistor network, ensuring there are no short circuit if a pin is set high while pressing the button.
Figure 5-4. Buttons and Joystick Connections
I2C BusTactile and Touch Button CircuitRemapping AreaBoard Overview
Info: I/O Expander 2’s 7-bit I2C address: 0x24.

5.5 Touch Controller

The three touch buttons are connected to the MTCH1030 touch controller. The touch buttons are sensed using capacitive touch sensors with active shields utilizing the Driven Shield Plus feature.

Response time, oversampling, touch sensistivity, easy tune, and single-button mode are configured through resistors networks on the bottom side of the Explorer. The parameters are read by the touch controller during power-up and only the single-button mode can be altered at run-time.

Info: OUTx pin indicates the touch detection state of BUTTONx. The pin idles in a high-impedance state. When the touch button is pressed, it switches to output-low.
Figure 5-5. MTCH1030 Connections
I/O Expander 2Board Overview
Info: The MTCH1030 enables anti-touch recalibration if a touch button pressed for more than 8s. This causes the OUTx pin to revert to a high-impedance state.
The MTCH1030 touch controller on the Explorer is configured as follows:
  • Measurement Period: Back-to-back measurements (minimum period)
  • Oversampling: Eight samples per measurement cycle
  • Sensitivity: 0-63
  • Easy Tune: Disabled
  • Single-Button Mode: Disabled
Tip: Touch sensor data captured with MTCH1030 can be visualized using the MPLAB® Data Visualizer, see section 10.1 MTCH1030 Touch Tune Data.

5.6 Standalone Touch Button

Underneath the Microchip logo is a single standalone capacitive touch button with an optional active shield.

If the microcontroller on the CNANO supports capacitive touch sensing, the standalone capacitive touch button can be used by connecting it to the remapping area from the 1x2 pin header J404. See section Direct Remapping. The sensor and shield pins are labeled in the silkscreen next to the pin header.
Figure 5-6. Standalone Touch Button
Board Overview
Tip: Generate code with the capacitive touch library in MCC Melody and visualize touch sensor data in MPLAB® Data Visualizer.