Skip to content

Infineon/micropython-radar-bgt60

Repository files navigation

MicroPython Driver for XENSIV™ BGT60TR13C 60 GHz Radar Sensors

Check links

With this library Infineon's XENSIV™ BGT60TR13C 60 GHz radar sensor can be configured and used with MicroPython via SPI.

Please refer to the product pages linked below for more information about the sensor and supported evaluation boards.

Note

This project is work in progress and not covering all functions of the sensor yet.
If you are missing any functionality feel free to contribute or open an issue.

Supported Products

XENSIV™ BGT60TR13C Demo kit with XENSIV™ BGT60TR13C 60 GHz radar sensor PSOC™ 6 Artificial Intelligence Evaluation Kit XENSIV™ connected sensor kit with XENSIV™ BGT60TR13C 60 GHz radar sensor

Getting Started

MicroPython Firmware Installation

Before using this module, ensure that the MicroPython firmware is installed on your microcontroller. If you are using a PSOC™ 6 board, you can find the installation instructions here. If you have a different MicroPython-compatible board, please refer to the official MicroPython documentation.

Dependencies

This module depends on the micropython-fourier module, written by Peter Hinch.

The dependencies are automatically installed when installing the module using the method described below.

Installation of this Module

Using mip (recommended)

Note

This method assumes that your MicroPython device is connected to the internet. If this is not the case, please refer to the manual installation instructions below.

You can install this module using mip, MicroPython's built-in package manager:

import mip
mip.install('github:infineon/micropython-radar-bgt60')

Manual Installation

And drag-and-drop them onto your MicroPython device using e.g. Thonny IDE or any other suitable tool.

Usage

Things to consider when using this Library

  • MicroPython executes code significantly slower than standard C, resulting in reduced performance when using this library:
    • measured time for a 128-bit chirp (fetch, FFT, high-pass filter, and logarithmic scaling): 59.93 ms or 16.68 Hz
  • The readFifo function can only transmit 8192 words, which consist of 24 data bits
    • Maximum transmission possible: 24.576 bytes
  • The chip returns an error when reading while the stack is full or empty
  • Data can be checked for overflow or underflow errors using the checkData function

Example Code

# import Module
import BGT60TRXX as BGT

# Create Instance
# An optonal parameter can be used to configure
# the Interrupt-Request to a user-defined function
radar_sensor = BGT.BGT60TRxxModule(<wordsize>, <optional function>)

# Configure Register Values with pre-defined functions
radar_sensor.setCompareValue(50) # in '%'
#...

# Configures all Registers for Usage
# They need to be configured before hand
radar_sensor.initSensor()

data = radar_sensor.read_reg(<ADDR_REG>)
radar_sensor.write_reg(<ADDR_REG>, <DATA>)

# reset fifo state
radar_sensor.resetFIFO()

# start frame generation before a fifo read
radar_sensor.startFrame()

# Reads from the Sensor.
# data is stored inside radar_sensor.data
radar_sensor.readFifo()

# Read and calculate Distance-Profile
# data is stored inside radar_sensor.data
radar_sensor.readDistance()

Releases

Used by

Contributors

Languages