Tool/software:
Hi team,
In the following code snippet (dab.h), why are the lower 8 bits of 'temp' masked?
static inline void DAB_calculatePWMDutyPeriodPhaseShiftTicks(void) { uint32_t temp; // // Calculation for the period is done in high resolution // as it is used by the phase shift variable in high resolution // temp = ((uint32_t)(((float32_t)(DAB_pwmPeriod_pu * DAB_pwmPeriodMax_ticks) * (float32_t)65536.0)))>> 1; DAB_pwmPeriod_ticks = temp & 0xFFFFFF00;
'DAB_pwmPeriod_ticks' is then only written to 'TBPRDHR' (I cannot find anywhere 'TBPRD' register is updated), could you please explain why is the period tick number not split to "TBPRD" and 'TBPRDHR' as described in the technical manual?
More details on how the HR tick is calculated are appreciated!