Driver library to interface with XENSIV™ BGT60TRXXX Radar Sensors in ModusToolbox™
XENSIV™ BGT60TRxx Radar Sensor

This library provides functions for interfacing with the XENSIV™ BGT60TRxx 60 GHz FMCW Radar Sensors. This library can be set up to use the ModusToolbox™ HAL interface, or using user-provided communication functions. For more information about the XENSIV™ Radar Sensor please visit the Infineon web page on radar sensors.

The BGT60TR13C Datasheet is available as part of Radar Development Kit which can be obtained through the Infineon Developer Center.

Once the Radar Development Kit is installed using the Infineon Developer Center follow the next steps to locate the BGT60TR13C Datasheet:

  1. Start the Radar Development Kit using Infineon Developer Center.
  2. Scroll down to Packages section. Download the Documentation package.
  3. Unzip the file RDK-Package.zip and open the BGT60TR13C Datasheet V2.4.6 document.

Quick start

For the hardware setup, see the Radar development kit user guide.

The initialization of the XENSIV™ BGT60TRxx radar sensor requires a list of registers that can be generated using the bgt60-configurator-cli tool.

The bgt60-configurator-cli is available part of Radar Development Kit which can be obtained through the Infineon Developer Center.

Once the Radar Development Kit is installed using the Infineon Developer Center follow the next steps to locate the bgt60-configurator-cli tool:

  1. Start the Radar Development Kit using Infineon Developer Center.
  2. Scroll down to Packages section. Download the Software package.
  3. Unzip the file RDK-TOOLS-SW.zip and browse into Tools folder.

The bgt60-configurator-cli tool takes as input a configuration file in JSON format specifying the radar parameters:

{
    "device_config": {
        "fmcw_single_shape": {
            "rx_antennas": [1], 
            "tx_antennas": [1], 
            "tx_power_level": 31, 
            "if_gain_dB": 60, 
            "lower_frequency_Hz": 61020098000, 
            "upper_frequency_Hz": 61479902000, 
            "num_chirps_per_frame": 1, 
            "num_samples_per_chirp": 128, 
            "chirp_repetition_time_s": 7e-05, 
            "frame_repetition_time_s": 5e-3, 
            "sample_rate_Hz": 2330000
        }
    }
}

Note: For the functionality of the following example, ADC channel 1 must be active because the data test mode works only on this channel. See the rx_antennas item in the configuration file.

Save the configuration as presence_radar_settings.json.

To generate the register file run in a command line window:

./bgt60-configurator-cli -c presence_radar_settings.json -o presence_radar_settings.h

Figure 1. bgt60-configurator-cli tool

Follow the steps below to create a simple application that checks basic functionality and connectivity to the radar sensor. The application configures the sensor according to the user defined configuration, enables the sensor test pattern generator on chip for data transfer check, starts the frame generation and compares the obtained data from the radar sensor on antenna RX1 against the defined bit sequence defined by the sensor test pattern generator.

  1. Create an empty ModusToolbox application for your board, e.g. KIT_PSE84_AI.
  2. Add this library, i.e. sensor-xensiv-bgt60trxx, to the application using the Library Manager.

    Figure 2. Library Manager

  1. Add the retarget-io library using the Library Manager.
  2. Define the following as as appropriate for your hardware/kit configuration:
    • PIN_XENSIV_BGT60TRXX_SPI_SCLK
    • PIN_XENSIV_BGT60TRXX_SPI_MOSI
    • PIN_XENSIV_BGT60TRXX_SPI_MISO
    • PIN_XENSIV_BGT60TRXX_SPI_CSN
    • PIN_XENSIV_BGT60TRXX_IRQ
    • PIN_XENSIV_BGT60TRXX_RSTN
    • PIN_XENSIV_BGT60TRXX_LDO_EN

      Note: The pins in the code example below correspond to the ones used in CYBSYSKIT-DEV-01 kit

  3. Place the following code in the main.c file.
  4. Connect the board to your PC using the provided USB cable through the KitProg3 USB connector.
  5. Open a terminal program and select the KitProg3 COM port. Set the serial port parameters to 8N1 and 115200 baud.
  6. Build the application and program the kit. After programming, the application starts automatically.

    Figure 3. Terminal output on program startup

Using the library for your own platform

The library can be used in your own platform copying the following files to your project:

  • xensiv_bgt60trxx.c
  • xensiv_bgt60trxx.h
  • xensiv_bgt60trxx_platform.h
  • xensiv_bgt60trxx_regs.h

The library depends on platform-specific implementation of functions declared in xensiv_bgt60trxx_platform.h:

/* Platform-specific function that sets the output value of the RST pin. */
void xensiv_bgt60trxx_platform_rst_set(const void* iface, bool val);
/* Platform-specific function that that sets the output value of the SPI CS pin. */
void xensiv_bgt60trxx_platform_spi_cs_set(const void* iface, bool val);
/* Platform-specific function that performs a SPI write/read transfer to
* the register file of the sensor. */
uint8_t* tx_data,
uint8_t* rx_data,
uint32_t len);
/* Platform-specific function that performs a SPI burst read transfer to
* receive a block of data from sensor FIFO. */
uint16_t* rx_data,
uint32_t len);
/* Platform-specific function that waits for a specified time period in milliseconds. */
/* Platform-specific function to reverse the byte order (32 bits). */
/* Platform-specific function that implements a runtime assertion. */
void xensiv_bgt60trxx_platform_rst_set(const void *iface, bool val)
Platform-specific function that sets the output value of the RST pin.
uint32_t xensiv_bgt60trxx_platform_word_reverse(uint32_t x)
Platform-specific function to reverse the byte order (32 bits).
int32_t xensiv_bgt60trxx_platform_spi_transfer(void *iface, uint8_t *tx_data, uint8_t *rx_data, uint32_t len)
Platform-specific function that performs a SPI write/read transfer to the register file of the sensor...
void xensiv_bgt60trxx_platform_assert(bool expr)
Platform-specific function that implements a runtime assertion; used to verify the assumptions made b...
int32_t xensiv_bgt60trxx_platform_spi_fifo_read(void *iface, uint16_t *rx_data, uint32_t len)
Platform-specific function that performs a SPI burst read to receive a block of data from sensor FIFO...
void xensiv_bgt60trxx_platform_spi_cs_set(const void *iface, bool val)
Platform-specific function that that sets the output value of the SPI CS pin.
void xensiv_bgt60trxx_platform_delay(uint32_t ms)
Platform-specific function that waits for a specified time period in milliseconds.

See an example implementation for the platform-specific functions in xensiv_bgt60trxx_platform.c using the PSoC™ 6 HAL.

More information