AnsweredAssumed Answered

eTPU PPA Overflow

Question asked by Joe Pasquariello on Jun 1, 2020
Latest reply on Jun 2, 2020 by Hui_Ma

Section 4.3 of AN2858 for the etpu PPA function contains the text shown below.

The functions etpu_ppa_get_immediate() and etpu_ppa_get_accumulation() return an 8 bit unsigned
value to indicate whether an overflow has occurred on the intermediate value or final accumulated value
An overflow is indicated when the most significant bit is set in the returned value.
A return value of 0 indicates that no overflow has occurred.

 I'm using eTPU on MCF5234. In my test setup, I supply a square wave to the PPA input pin and I successfully measure the period by calling etpu_ppa_get_accumulation() in the ISR for the PPA channel. If I disconnect the signal from the PPA input pin, I get overflow interrupts at the expected frequency. However, etpu_ppa_get_accumulation() returns 0 (no error) even when an overflow occurs. I must call etpu_ppa_get_immediate() to see whether an overflow has occurred. Can you explain why etpu_ppa_get_immediate() returns 0x80, but etpu_ppa_get_accumulation() returns 0x00? Is this the expected behavior? Is there any other way to read the status value to determine overflow?


Thank you.