1.5.16.14 PDECx_HALLTimeWindowSet Function

C

bool PDECx_HALLTimeWindowSet ( uint16_t low_window, uint16_t high_window ) // x is instance of the peripheral and it is applicable only for devices having multiple instances of the peripheral.

Summary

Writes the low and high window threshold for hall mode

Description

This function configures low and high window threshold values.

Precondition

PDECx_HALLInitialize function must have been called first for the given channel.

Parameters

Param Description
low_window lower window threshold CC0[MSB]
high_window higher window threshold CC1[MSB]

Returns

true - If Time Window set false - If Time Window is not set

Example

PDEC_HALLInitialize();
PDEC_HALLStart();
PDEC_HALLTimeWindowSet(1000, 60000);

Remarks

Window counter COUNT (MSB) is compared against low and high window threshold and if the counter is outside the window, error flag is set. This can be used to detect if motor is running too slow or too fast.