20. Hall
20.1. Overview
Hall project demonstrates the output of Hall timer data using the serial port after triggering the hall interrupt
Hall interrupt configuration and handling
Reading Hall UVWTIMER register data
TRGM (Trigger Manager) configuration
20.2. Implementation Details
Initial Configuration: - Configure TRGM input sources for U, V, W hall signals - Configure and enable interrupt - Configure hall counter and phase count - Configure data reading trigger on U phase signal change
Interrupt Handling: - Clear status flags in hall interrupt - Set data ready flag to trigger data reading in main loop
Data Reading: - Wait for data ready flag in main loop - Read U, V, W phase counter values and timer counter value - Print data through serial port
20.3. Configurations
Install the serial terminal, view board information , and configure the serial terminal parameters
This program uses the BLM57050-1000 brushless motor of “Leisai Intelligence”, refer to the Leisai Intelligence website for the specific parameters of the motor.
Click DRV-LV50A-MP1907 Motor Driver Board section and configure
20.4. Running the Demo
After power-on, open the serial terminal, startup message will be printed
When rotating the motor shaft, hall interrupt will be triggered and print: - u: Hall counter value for U phase - v: Hall counter value for V phase - w: Hall counter value for W phase - timer: Timer counter value
The data changes with rotation speed and direction, refer to user manual for details
> u: 0xe0000000
> v: 0x87b6d17c
> w: 0x46999a8
> timer: 0xe149af9