SPI Data Capture Users Guide
Table of Contents
Overview of SPI Data Capture
This fundamentals demo user guide will walk through the necessary steps needed in order to capture xWRL6432 radar output data via the Serial Peripheral Interface (SPI) synchronous serial communication protocol. Traditionally radar output has been sent over UART, but this has several limitations with the most impactful being a maximum transfer speed too low to support raw data transfer. With this demo you can transfer processed data and now raw ADC data as well without the use of a DCA1000 via SPI.
Prerequisite
⚠️ Run Motion and Presence Demo
Before continuing with this fundamentals demo, users should first run the out of box also known as the Motion and Presence demo for the EVM. This will enable users to gain familiarity with the sensor’s capabilities as well as the various tools and terminology used across examples found in the Radar Toolbox.
Quick Start
This section allows you to start with minimal prerequisite software and changes
📝 NOTE
The quick start section is only applicable for capturing raw ADC data with FTDI. You will need to go to the developer section of this user guide for 1D FFT or 2D FFT transfer as well as any kind of data transfer using a logic analyzer.
Software Requirements
Tool | Version | Download Link |
---|---|---|
TI Radar Toolbox | 2.30.x | Download the Radar Toolbox |
Hardware Requirements
Tool | Description | Related Link |
---|---|---|
xWRL6432BOOST OR xWRL6432AOPEVM |
TI Low Power mmWave Sensor | IWRL6432BOOST IWRL6432AOPEVM |
(xWRL6432BOOST only) FTDI Cable | xWRL6432AOPEVM has a built in FTDI chip while the xWRL6432BOOST does not. For this user guide we will reference the cable linked here as a secondary option to a FTDI chip. | Example FTDI Cable |
(Optional) Logic Analyzer | For those who want to do SPI transfer via Logic Analyzer rather than a FTDI chip/cable | Example Logic Analyzer |
Flash Prebuilt Binary
Within this fundamentals demo’s prebuilt binaries folder are .appimage files that are configured for “Raw ADC data” transfer using SPI and FTDI.
📝 NOTE
Raw data when mentioned in TI mmWave Radar documentation refers to unprocessed, unfiltered, dumped real/complex ADC data straight from the buffer. For output such as a point cloud, please refer to the motion and presence demo as mentioned in the prerequisite section
Flash the appropiate radar .appimage demo file for your device using Uniflash. For more information on how to do this, please see the using Uniflash with mmWave guide.
Once done set the switches as show below to prepare for SPI raw data transfer over FTDI.
For xWRL6432BOOST, make sure that S1.1 and S1.6 are ON
For xWRL6432AOPEVM, make sure that S1.6 is on and both S1.5 and S4.3 are OFF
Run SPI Data Transfer Executable
Within the Radar Toolbox’s in the C:/ti/<RADAR_TOOLBOX>/tools/SPI_Data_Capture/
directory is the spi_data_capture_tool.exe
executable file. Running this file will prompt you to select a configuration file and you will need to do the following steps.
- Navigate to
C:<RADAR_TOOLBOX>/source/ti/examples/Fundamentals/xWRL6432_Raw_Data_Over_SPI/chirp_configs/
, select your device, and open that device’s FTDI .cfg file. - Confirm device type between AOP and FCCSP (BOOST EVM). Confirm the data format as ADC data
- The FTDI port will open and data capture will begin automatically.
Developer’s Guide
Software Requirements
Tool | Version | Download Link |
---|---|---|
TI Radar Toolbox | Latest | Download the Radar Toolbox |
TI MMWAVE-L-SDK | 5.4.0.1 | Download the MMWAVE-L-SDK |
Code Composer Studio (CCS) | Latest | Download Code Composer Studio |
Python | 3.10+ | Download Python 3.10+ |
Hardware Requirements
Tool | Description | Related Link |
---|---|---|
xWRL6432BOOST OR IWRL6432AOPEVM |
TI Low Power mmWave Sensor | IWRL6432BOOST IWRL6432AOPEVM |
(xWRL6432BOOST) FTDI Cable | IWRL6432AOPEVM has a built in FTDI chip while the xWRL6432BOOST does not. For this user guide we will reference the cable linked here as a secondary option to a FTDI chip. | Example FTDI Cable |
(Optional) Logic Analyzer | For those who want to do SPI transfer via Logic Analyzer rather than a FTDI chip/cable | Example Logic Analyzer |
Python Libraries
These libraries are needed if running the tool from source as opposed to the executable.
Library | Version |
---|---|
ftd2xx | 1.3.8 |
numpy | 2.1.2 |
readchar | 4.2.0 |
pyserial | 3.5 |
Prepare for SPI based Data Capture
- Import the .projectspec into CCS. This file is found in the “/src” folder of the respective device.
- Once imported, open mmw_cli.h and specify the desired data capture format and mode with the following predefined macros:
- SPI_DATA_STREAMING (1 -> Raw ADC, 2 -> 1D FFT, 3 -> 2D FFT Transfer)
- SPI_DATA_STREAMING_MODE (1 -> Via FTDI Chip, 2 -> Via Logic Analyzer, 0 -> No Transfer)
- Rebuild the project
- Flash the generated appimage file using UniFlash or any other flashing methodology.
- Setup the device for SPI transfer
- For xWRL6432BOOST, make sure that S1.1 and S1.6 are on
- For IWRL6432AOPEVM, make sure that S1.6 is on and both S1.5 and S4.3 are off
📝 NOTE
Requirements in Configuration file
- adcLogging should be 2.
- Disable lowPowerCfg
- For Raw ADC data streaming, ensure that the size of the data generated is within 96KB per frame.
(Size of the ADC Data per Frame = numAdcSamples * numChirpsPerBurst * numBurstsPerFrame * numRxAntenna * 2 )
- SPI Header for xWRLx4xx device. (DCA_LP_HOST_INTR_1 is SPI BUSY SIGNAL)
FTDI Chip Data Capture
The IWRL6432AOPEVM has an FTDI chip built into it. The xWRL6432BOOST does not have an FTDI chip and will require separate hardware to do FTDI transfer. For this users guide, we will be referencing the C232HM FTDI cable when discussing FTDI capture with xWRL6432BOOST.
Ensure that the D2XX drivers are installed in your PC
- If using a xWRL6432BOOST, connect the SPI lines with a FTDI cable with below as an example
- If using a xWRL6432BOOST, connect the SPI lines with a FTDI cable with below as an example
Navigate to
<RADAR_TOOLBOX_INSTALL_DIR>/tools/SPI_Data_Capture
to find the SPI via FTDI python capture script namedspi_data_capture_tool
.Execute spi_data_capture_tool.exe or run the command
python spi_data_capture_tool.py
in your command line.Select a CFG to send to the device, default configuration files can be found within the “chirp_configs” folder of this demo.
The console window will print out the CFG, every successful line will have a “Done” line underneath it as direct confirmation from the sensor.
Confirm device type between AOP and FCCSP (BOOST EVM). Confirm the data format as well between raw ADC, 1D FFT, or 2D FFT.
The FTDI port will open and data capture will begin automatically.
After a successful capture, there will be a file named “data_0.txt” in the same directory as the script’s location. Subsequent runs will increment the file number.
⚠️ Remember to power cycle in between runs ⚠️
📝 NOTE
Data format in FTDI Chip Capture
- Raw ADC, 1D and 2D FFTs are sent out through SPI with 32 bits per transfer.
- In the text file, Raw ADC values are stored as signed int16. Real and Imaginary values are stored as signed int16 alternatively for 1D FFT. For the 2D FFT, each entry is an unsigned int32.
Logic Analyzer Data Capture
Connect the SPI lines of the radar sensor (MOSI, MISO, CS, CLOCK, and GND) and setup Logic Analyzer. Users have to ensure that sufficient sampling rate is supported by their device and configured in your Logic Analyzer program. Settings used can be found below. The raw data capture example shown below was done at 300 MS/s, but successful capturing of raw data can possibly be achieved with lower speeds.
Issue sensorStart command from TeraTerm.
View the output waveform and save the captured data.
📝 NOTE
Data format in Logic Analyzer Capture
- Raw ADC, 1D and 2D FFTs are sent out through SPI with 32 bits per transfer.
- For Raw ADC, each 32 bit entry in logic analyzer should be decoded as two signed int16.
- For the 1D FFT, The first 16 bits are signed int real and the last 16 bits are signed int imaginary.
- For the 2D FFT, The format is unsigned int32.
Parsing Data Text File
Raw Data
Within the MMWAVE-L-SDK, the path <MMWAVE_SDK5_INSTALL_DIR>/tools/ADC_parser
includes MATLAB based parsing and post processing scripts for interpreting raw ADC data acquired through SPI. This is done in Test_read_adc_data_xWRLx432.m and some adjustments are needed before the script is ran
The variable
adcLogging
will need to be set to2
to signify that the script is to read in a .txt file generated by the SPI data capture scriptThe
fopen
line at the top needs to be set to the configuration file used during capture.
Set the second
fopen
line which is found under theelseif adcLogging == 2
line to the name of the .txt file to be processed.
Run the script. If done correctly after a moment you will see four different graphs appear showcasing different example postprocessing algorithms ran on the raw data.
The FFT peaks are a means of validating the captured raw ADC data. For example, a corner reflector is placed at 1m along the boresight of the radar. Assuming an FFT bin resolution of 0.1m/bin (derived based on chirping parameters), the 1D FFT peak falls into the 10th bin.
The values when viewed in notepad should be around -150 to 150
1D (Radar Cube) and 2D (Detection Matrix) FFTs
There are no MATLAB parsing scripts provided for doing the processing on the .txt files for Radar Cube or Detection Matrix as done in the Motion and Presence demo. However the raw data MATLAB script can be used as a starting point and changed to support the respective formats found below.
Format Name | Declaration | Content |
---|---|---|
DPIF_RADARCUBE_FORMAT_6 | cmplx16ImRe_t x[numChirps][numTxAnt][numRxAnt][numRangeBins] | 1D Range FFT output |
DPC_DPU_DPIF_DETMATRIX_FORMAT_2 | uint16_t x[numRangeBins][azimuthFFTsize] | Range-Azimuth Detection Matrix |
Need More Help?
- Learn about the foundations and fundamentals of TI Radar with the Radar Academy
- Additional resources in the documentation of the mmWave SDK:
- mmWave SDK5 Documentation
<MMWAVE_SDK5_INSTALL_DIR>/docs/api_guide_xwrL64xx/index.html
- mmWave SDK5 Motion and Presence Documentation
<MMWAVE_SDK5_INSTALL_DIR>/docs/api_guide_xwrL64xx/MOTION_AND_PRESENCE_DETECTION_DEMO.html
- mmWave SDK5 Motion and Presence Tuning Guide
<MMWAVE_SDK5_INSTALL_DIR>/docs/MotionPresenceDetectionDemo_TuningGuide.pdf
- mmWave SDK5 Documentation
- Quickly create or view the performance of a chirp configuration using the mmWave Sensing Estimator
- Search for your issue or post a new question on the mmWave E2E forum