Where to find example of PPWA (24bit!) function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where to find example of PPWA (24bit!) function

1,016 Views
bwkb
Contributor I
Dear forum user,
 
Where can I find an example of how to use the PPWA (Time Processor Unit) function using 24 bits (instead of only 16).
I've already searched for answers in this forum (and using Google) but found none (found a related but unanswered question in this forum category). I also have the Freescale docs on the PPWA but they only describe the use of 16 bits. From this document, it seems that using 24 bits is quite easy although no real example is included.
 
I've successfully written a program using only 16 bits but the problem is that to correctly read my sensor value (producing PWM output) I need all 24 bits. From the documentation I know that I have to reset the PPWA_UB byte after each accumulation. The question is on how to do this (it doesn't seem a trivial thing to do)?
Can anyone help me with this?
 
 
Help is highly appreciated,
Kind regards
bwkb
Labels (1)
0 Kudos
2 Replies

379 Views
stzari
Contributor III
Hi,

I suppose this is for the 68332 TPU PPWA function ?
Do you have the application note TPUPN11 where the function is described ?

For resetting PPWA_UB it's just writing 0 to its address.
HTH
  stzari
0 Kudos

379 Views
bwkb
Contributor I
>> I suppose this is for the 68332 TPU PPWA function ?
 
Yes, it is.

>> Do you have the application note TPUPN11 where the function is described ?
Yes, but this document only includes examples using 16 bits only. From the explanation given there all you need to do is to reset the register (as you suggested). But in practice (at least for me), it's not that simple. It don't really know where (in which part of the program) to reset this register. I've already tried different things but the content of PPWA_UB continues to increase (until overflow). It keeps on behaving as a counter.
 
I've added the code I've written so far (doesn't work ...yet...).
0 Kudos