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.
Software Requirements
Tool | Version | Download Link |
---|---|---|
TI MMWAVE-L-SDK | 5.4.0.1 | Download the MMWAVE-L-SDK |
Code Composer Studio (CCS) | Latest | Download Code Composer Studio |
Python | 3.8+ | Download Python 3.8+ |
Hardware Requirements
Tool | Description | Related Link |
---|---|---|
xWRL6432BOOST OR xWRL6432AOPEVM |
TI Low Power mmWave Sensor | IWRL6432BOOST IWRL6432AOPEVM |
(xWRL6432BOOST) 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 |
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 xWRL6432AOPEVM, 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 xWRL6432AOPEVM 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
Navigate to
<RADAR_TOOLBOX_INSTALL_DIR>/tools/SPI_Data_Capture
to find the SPI via FTDI python capture script namedspi_data_capture_tool.exe
.To run the script from source, install the follow python packages for the data capture script then execute
spi_data_capture_tool.py
file in command prompt:- ftd2xx
- readchar
- tkinter
- pyserial
- numpy
Execute spi_data_capture_tool.py file in command prompt and provide all the required parameters like numAdcSamples, numChirps, numBursts, numFrames etc as per the configuration file.
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.
⚠️ 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.
- The above file path can be updated in the post processing script Test_read_adc_data_xWRLx432.m, to compute 1D and 2D FFTs.
- 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. 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