Embedded Computing
  • About
  • Blog
  • Hardware
    • Which Platform?
    • Controller Platforms >
      • Adafruit Platform
      • Arduino Plaform
      • BBC micro:bit
      • Espressif Platform
      • iLabs Platform
      • Raspberry Pi Platform (MCU)
      • Seeed Platform
      • Silicon Labs Platform
      • Teensy Plaform
    • Computer Platforms >
      • BeagleBone Platform
      • Raspberry Pi Platform (SBC)
      • UDOO Platform
    • Peripherals >
      • Shields
      • Grove System
      • Sensors
      • Actuators
    • Displays >
      • E-Paper Displays
      • Reflective Displays
      • TFT Displays
      • LCD Displays
    • Legacy Platforms >
      • chipKIT Plaform
      • 4D Systems Platform
      • Intel Platform
      • LaunchPad Plaform
      • BoosterPacks for LaunchPads
      • LightBlue Bean
      • Maple Plaform
      • Mediatek Platform
      • Microsoft Azure IoT DevKit
      • Particle Platform
  • Software
    • Exploring RTOS with Galaxia >
      • Event Library
      • Semaphore Library
      • Mailbox Library
      • Timer Library
      • Clock Library
      • SWI Library
      • Task Library
    • Ultra-Low Power with EnergyTrace >
      • Ultra-Low Power with MSP430
      • Ultra-Low Power with Energia MT and Galaxia
    • Using Integers Instead of Reals
    • Going Python?
  • IoT
    • IoT Platforms: Which Hardware? >
      • Matter with Silicon Labs MG24
    • IoT Services: Which Solution? >
      • Recommended IoT Solutions
      • Platform-Specific IoT Solutions
      • Other IoT Solutions
      • Not tested IoT Solutions
      • Notification Solutions
    • Get Date and Time from Internet with NTP
    • Fast and Easy WiFi Connection with QR-Code
  • Tools
    • How to Start?
    • Reference >
      • Asking for Help
      • Boards Pins Maps
      • Ruler
      • Boards and Plugs
      • I²C Logic Level Converter
      • Standards for Connectors
    • Training >
      • Texas Instruments Workshops
      • Embedded Systems: Shape The World — MOOC edX UTAustinX UT.6.02x
      • Embedded Systems - Shape The World: Microcontroller Input/Output — MOOC edX UTAustinX UT.6.10x
      • Embedded Systems - Shape The World: Multi-Threaded Interfacing — MOOC edX UTAustinX UT.6.20x
      • Real-Time Bluetooth Networks: Shape the World — MOOC edX UTAustinX UT.RTBN.12.01x
      • Systems Thinking with Texas Instruments Robotics System Learning Kit
    • Books >
      • Getting Started with the MSP430 LaunchPad
      • Getting Started with Arduino
      • Arduino Cookbook
    • IDE >
      • The Battle of IDEs
      • More Options
      • Assessing the Next Generation of IDEs
      • Tools for Documentation
    • Equipment >
      • Saleae Logic Analyser
      • Rigol DS1102E Oscilloscope
      • XDS110 Debug Probe with EnergyTrace​
      • Segger J-Link Programmer-Debugger
      • Nordic Power Profiler Kit II
  • Projects
    • Libraries >
      • Master I²C Software Library
      • Date and Time Library
      • highView Library Suite
      • Others Libraries
    • smartDevices >
      • I²C smartColours Smart Sensor
      • I²C smartRFID Smart Sensor
      • I²C smartLED Display
      • I²C smartControls Smart Device
      • I²C smartWiFi Smart Device
      • I²C smartBLE Smart Device
      • I²C smartNode Smart Device
    • IoT Projects >
      • Remote E-Paper Weather and Message Board
      • Typie-Walkie with LoRa and E-Paper Screen
      • Typie-Walkie with E-Paper Screen
      • Remote e-Paper Pictures Panel
      • Remote e-Paper Messages Panel
      • Industrial IoT Project
      • Remote Contactless Temperature Monitor
      • Using Node-RED for IIoT
      • Low Power Home Network Weather Monitoring
      • Updated Low Power Home Network Weather Monitoring
      • Weather and Security Station with Blynk
      • SensorTag to Blynk Using Node-RED
      • Pervasive Reporting
    • AI Projects >
      • Colour Recognition with Neural Network
    • Other Projects >
      • Air Quality Monitoring
      • Driving a Large E-Paper Display with a Compact Xiao RP2040
      • Low-Power E-Paper Weather Station
      • Portable Particulate​ Matter Monitor
      • FRAM-based E-Paper Screen Controller
      • General Purpose 3.5" Screen
      • Colour Recognition with Neural Network
      • A Low Power Weather Station
      • Digital Volt-Amp-Watt Meter
      • Mobile Measurement with LCD Display
      • Screen with SRAM for GUI
      • Volt-Amp-Watt-Meter for Grove
      • Multi-Touch Project with CapTIvate

Multi-Touch Project with CapTIvate

This project uses the CapTIvate MCU Development Kit as a BoosterPack and displays the pads on the Kentec 3.5" SPI screen. 

The idea is to design a generic capacitive board I could use with different projects, like a board with 8 x 8 pads for a calculator.

This project shows an example of a programmable sensor.

Step 0: Hardware and Software

Hardware includes (external links)
  • MSP432 LaunchPad,  
  • Kentec 3.5" SPI BoosterPack,  
  • CapTIvate MCU Development Kit, 
  • and optionally a custom capacitive board. 

Software is available on Windows, Linux and macOS (external links)
  • CapTIvate Design Center GUI,
  • Code Composer Studio, and
  • Energia 1.6.11E18.
Picture
Picture

Step 1: Prepare the Hardware

To turn the board with the MSP430FR2633 MCU into a BoosterPack, we are going to use the holes the board provisions for the extended 40-pin BoosterPack.

However, the MSP430FR2633 board only uses ​20 pins, so we solder those 20 pins only.
 
Picture
The CapTIvate board rises an interrupt on pin 8 and sends the messages in bulk, through either the UART port (pins 3 and 4) or the  I²C port (pins 9 and 10).

​This project uses the I²C port, so we remove the jumpers for UART, TXD/P1.4 and RXD/P1.5. 

​This frees the UART port on the LaunchPad (pins 3 and 4) for the serial console.
​
Picture

Step 2: Configure the BoosterPack

We're going to use CapTIvate Design Center GUI, available for Windows, Linux and macOS, to
  • Design the capacitive board, 
  • Configure the MSP430FR2633, and  
  • Generate the code.

Configuring a capacitive board is very easy thanks to the automatic options, one for assigning the I/O and another for generating the code. 

Picture
Let's work with CapTIvate Design Center GUI:
  • Open the CapTIvate Design Center GUI,
  • Call the menu File > Project New to create a new project, name it,
  • Drag and drop a controller and a button group from the tool bar to the working space,
  • Double click on the button group to open the Button Sensor Properties window, 
    • Set Element group to 64,
    • Close the Button Sensor Properties window,
Picture
  • Double click on the controller to open the Controller Properties window, 
    • Select MSP430FR2633 IRHB as Device, 
    • Click on Auto-Assign or assign the Unconnected electrodes to the Sensors BTN00 manually,
    • Check the OK label is green,
    • Click on Generate Code Source, 
    • Close the Controller Properties window,
  • Call the menu File > Project Save to save the project.

Picture
Referring to the schematics helps and improves the assignation of the elements to the TX and RX ports. ​​
Picture
​Let's work with Code Composer Studio:
  • Open Code Composer Studio,
  • Call the menu Project > Import CCS Project and select the project generated previously,
  • Click on the hammer icon or call the menu Project > Build Project to build the project,
Picture
  • ​Prepare the hardware by assembling the different boards together, from left to right:
    • ​the capacitive board, 
    • the CapTIvate BoosterPack,
    • the programmer board.
  • ​Then connect the programmer board to the USB port of the computer.
Picture
Back to Code Composer Studio,
  • Click on the bug icon or call the menu Run > Debug to upload the program to the MSP430FR2633 and launch the debugger. 
  • Click on the red square to end the session. 
Picture
To check every works fine,
  • Return to CapTIvate Design Center GUI,
  • Call the menu Communication > Connect, and
  • Move one finger on the capacitive board. 

​The screen shows the pads with proximity in orange and the pads with touch in green.
Picture

Step 3: Program the LaunchPad

I'm using the MSP432 LaunchPad using Energia 1.6.10E18. Energia is based on the Arduino / Wiring framework. Please find the project on the right.
​
The project calls three libraries:
  • the Wire library for the I²C protocol to communicate with the CapTIvate BoossterPack, 
  • the SPI library for the SPI protocol to communicate with the Kentec screen BoosterPack,
  • the Screen_K35_SPI library  for the Kentec 3.5" SPI screen is bundled with Energia.​​

Data Acquisition

One single function getCapTIvate64() acquires and processes the data from the BoosterPack.

The function 
isSomething() returns true if there is at least one pad with proximity or touch.
​
There are five kinds of messages called packets but our project only uses the Cycle Packet, which eases reading and decoding.

Remember, the capacitive board has been configured with 1 sensor, 16 cycles of 4 elements each, for a grand total of 64 pads. 
​
Picture
A message includes
  • one preliminary byte with the length of the message,
  • byte 0 is the Command Byte, always 0 for Cycle Packet,
  • byte 1 is the Sensor ID Byte, always 0 in the project,
  • byte 2 is the Cycle ID Byte, 0~15 in the project,
  • bytes 3 to 5 are the Cycle State Bytes with, the first 12 bits (MSB) for proximity and the last 12 bits (LSB) for touch, one bit per element of the cycle.
  • the remaining bytes of the message (except the last 2) are the Element LTA and Element Count Bytes, 4 bytes by element​ and 4 elements, with details (long term average and count) for each element of the cycle,
  • the last two bytes of the message for the 16-bit checksum (CRC).

​Texas Instruments provides all the information needed with the Technology Guide.

A 
logic analyser was very helpful for decoding the I²C messages! 
Picture
The Cycle Packet Format
Picture
The IRQ signal and the I²C frame

Screen Management

The two functions prepareScreen() and refreshScreen() manage the screen. To speed up display, only modified areas are updated. 
​
The screen is refreshed only
  • after the 16 cycles have been completed, and  
  • if there are pads with proximity and pads with touch.

The screen shows the pads with proximity in orange and the pads with touch in green.
Picture

Step 4: Build and Run the Program

​Let's work with Energia:
  • Open Energia,
  • Call the menu File > Open and select the sketch CapTIvate_64.ino,
  • Click on the check icon or call the menu Sketch > Verify/Compile to compile the sketch,
Picture
  • Prepare the hardware by assembling the different boards together, from bottom to top:
    • ​the CapTIvate BoosterPack connected to the capacitive board, 
    • the MSP432 LaunchPad,
    • the Kentec 3.5" SPI screen.
  • Then connect the MSP432 LaunchPad to the USB port of the computer.

Back to Energia, 
  • Click on the arrow icon or call the menu Project > Upload to upload the binary to the MSP432 LaunchPad.
  • Move one finger on the capacitive board. 
Picture
Multiple areas are displayed on the screen as CapTIvate tracks multi-touch.

The screen shows the pads with proximity in 
orange and the pads with touch in green.

Optionally, use Code Composer Studio instead of Energia.
  • Open Code Composer Studio,
  • Call the menu Project > Import Energia Project and select the sketch CapTIvate_64.ino,
  • Proceed as previously, build and upload. ​
Picture
On the picture on the right, I put my left hand on the capacitive board: the board detected 8 pads with touch and 7 pads with proximity.
Picture

Conclusion

The CapTIvate is very efficient in sorting signal from noise, and touch from proximity. 


Picture

Links

  • CapTIvate landing page
  • Hardware
  • Software
  • Technology Guide

Download

captivate_64.zip
File Size: 3 kb
File Type: zip
Download File

Powered by Create your own unique website with customizable templates.