SPRAC77E January 2022 – February 2022 TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
Divider initialization is done via the function below:
Index pulse width is controlled using COUNTER_2 in CLB1 for match1 value setting.
uint16_t
pto_qepdiv_config(uint16_t divider, uint16_t indexWidth)
{
CLB_writeInterface(CLB2_BASE, CLB_ADDR_COUNTER_0_MATCH2, divider * 4);
CLB_writeInterface(CLB2_BASE, CLB_ADDR_COUNTER_0_MATCH1, divider * 2);
CLB_writeInterface(CLB1_BASE, CLB_ADDR_COUNTER_2_MATCH1, indexWidth - 1);
return(divider);
}