Follow these basic steps to configure the IEP Timer.
Counter maintains/function:
- Once enabled, the counter will count every ICSSG_IEP_CLK cycle, default rate of 200 MHz.
- It is a free running counter with a sticky over flag status bit.
- The counter over flow flag (IEP_GLOBAL_STATUS_REG[0] CNT_OVF) will get set when the counter switches/rollsover from 0xFFFF_FFFF to 0x0000_0000.
- The counter will continue to count up. The software will need to read/clear the counter over flow flag and increment the MSB in software variable.
Compare function:
- Initialize timer to known state (default values)
- Set compare values IEP_CMPj_REG0, IEP_CMPj_REG1 (where j = 0 to 15)
- Enable compare events (IEP_CMP_CFG_REG[16-1] CMP_EN = 1)
- Set increment value (IEP_GLOBAL_CFG_REG[7-4] DEFAULT_INC)
- Set compensation value (IEP_COMPEN_REG[22-0] COMPEN_CNT)
- Enable counter (IEP_GLOBAL_CFG_REG[0] CNT_ENABLE = 1)
Capture function:
- Update/Enable the counter if required
- Program the enable the desired capture event
- Wait for global capture event
- Read/Clear the capture status to determine which capture event occurred
- Read the capture count