MPC5554 - PWM eTPU Function

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

MPC5554 - PWM eTPU Function

3,604 Views
n_
Contributor II
I want to create an interrupt for each rising edge of the PWM signal using PWM eTPU function. I have read many eTPU Application Notes and the eTPU Reference Manual, but I can't find the solution.
How can I do that? What register do I need to configure or what API do I need to use? 
Please guide me the solution and what document it is mentioned.
 
Thanks,
 
   
Tags (1)
0 Kudos
Reply
4 Replies

1,306 Views
n_
Contributor II
Thank power pc for all useful information in your posts.
It's the first time I programs for eTPU. I don't have any book about programming for eTPU. I have just read eTPU_RM and Application Notes about eTPU functions and try to understand by my way.
Please explain for me more about micro code entry point and m0 and m1 in your code. I see m0 and m1 is the last value and current value of the PWM signal, but how to read it from eTPU channel.
According to you, what document or book are useful for me to have enough knowledge to program eTPU?
 
Thanks and regards,
   
0 Kudos
Reply

1,306 Views
mr_venkatarao
Contributor I
Hi find the etpu examples in code warrior ide and  download the  bytecraft copmiler in the site given http://www.bytecraft.com/depot/depot.php.
 
 
Write micro code in byte craft compiler then it generares .h file, include the same in the main project.
 
 
Initialisation for the channels and channel paramater base address everything is given in that example..follow the same.
 
if
{
}
else if
{
}
else
{
}
 
these are entry point....
 
if
{
 
contains chnnel and function initilisation..like either i/p or o/p,which tcr to be used etc..
}
else if
{
contians incrementing period value foe the next match
 
 
}
else
{this is also as same as above..
}
 
 
so better to understand example given..
 
 
regards,
venki
0 Kudos
Reply

1,306 Views
mr_venkatarao
Contributor I
And you can also generate squre wave with linearly  increasing with time..
it is so simple just you have to increase period and it's  duty cycle periodically...if you are writing micro code on your own it is so simple insted of using  freescale code API.
 
regards,
venki
0 Kudos
Reply

1,306 Views
mr_venkatarao
Contributor I
Hello n ..in micro code entry point...i.e in   if ,if else conditions you have to use the following assembly code   #asm
                            cir.
                           #endasm
 
 
for eg...............
 
 
 if()
{
\---
----
}
else if(m1==1&&m2==0)
{
--
--
#asm
cir.
#endasm
}
else if(m1==0&&m2==1)
{
--
--
#asm
cir.
#endasm
}
 
so this willl generate interrupt at both rising edge and falling edge of pwm signal..uoy can generate only at either edge also... hope this will help you.
 
 
regards,
venki
0 Kudos
Reply