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
respectively.
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.
Hi,
I checked support records with below description, wish it helps.
Overflow sets CIS bit.
You can check variable StatAcc and variable Status (get_accumulation returns Status variable, get_immediate returns StatAcc).
If MSB of StatAcc is set and Status is cleared => CIS bit was set due to overflow If MSB of StatAcc is cleared and Status is set => CIS bit was set due to end of measurement and additionally there have been an overflow.
If MSB of StatAcc and Status are cleared both => CIS bit was set due to end of measurement and there have been no overflow.
best regards,
Mike