Re: strange tpu pwm problem

"fatih_lokumcu" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
 Thanks for your reply Eric, 
I think you are the one from the company that does everything 
imaginable with that tpu.
I never thouth of that low power issue, I will consider it. 
But when these two lines are added to my code 

tpub->TPUMCR3.B.EPSCKE = 0x01;//epsck enable
tpub->TPUMCR3.B.EPSCK = 0x1f;//system clock/64

which makes the system clock divided by 64 instead of 32 (with new 
period value of 17500 now of course) it works fine. 
I did not know that would solve the problem when I first post the 
message. Anyway the problem is solved but it is now more strange with 
this new issue.


--- In [email protected], Eric McRae <eric@e...> wrote:
> Is it possible that your outputs are configured for low power drive 
and 
> that the signal is just not able to climb to logic 1 below 6% high 
time?
> 
> fatih_lokumcu wrote:
> 
> > Hello,
> > I have a strange problem. I use the tpu pwm function to
> > produce a 20 hz pwm which varies between %5 and %10 duty cycles 
for
> > servo control.
> > I have metrowerks mpc5xx edition 8.0 with phycore 565 board.
> > It works fine between %6 and %10 duty cycles but all of the lower
> > duty cycle commands lead to a %0 duty cycle. (which has a low 
time of
> > 250 ns.)
> >
> > Here is my code:
> >
> > UINT16 period ;
> > UINT16 hightime;
> > struct TPU3_tag *tpub = &TPU_B;
> >
> > void InitServo(void) {
> >       period = 35000;
> >       hightime = 2232;
> > tpu_pwm_init
(tpua,0,TPU_PRIORITY_HIGH,period,hightime,TPU_PWM_TCR1);
> >
> > }
> >
> > when TCR1 is used with  PSCK = 0 it it divides the 56 mhz clock 
by 32
> > and period value of 35000 makes the wave 20 hz. So to produce the 
pwm
> > between 1ms and 2ms duty cycle hightime must be between 3500 and 
1750.
> > The code above works fine until the hightime is set below 2232. I
> > tried to change the hightime with tpu_pwm_update function but 
nothing
> > has changed. There is no scheduling problem since no other tpu
> > funtion is used.
> > Also, the same code works with phycore mpc555 (with period = 25000
> > for 40 mhz of course.) without any problem.
> >
> > Is there any explaination for this?
> >
> > Thanks in advance,
> >
> > Fatih Lokumcu.
> >
> >
> >
> >
> >
> >
> > -----------------------------------------------------------
> > To learn more about Freescale Microcontrollers, please visit
> > http://www.freescale.com/mcu
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------
------
> > *Yahoo! Groups Links*
> >
> >     * To visit your group on the web, go to:
> >       http://groups.yahoo.com/group/MPC500/
> >        
> >     * To unsubscribe from this group, send an email to:
> >       [email protected]
> >       <mailto:[email protected]?
subject=Unsubscribe>
> >        
> >     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> >       Service <http://docs.yahoo.com/info/terms/>.
> >
> >
> 
> -- 
> Eric McRae, Electro-Logic Machines, Inc.
> 511 Root St., Port Townsend WA, 98368
> Phone/Fax: 360.379.0969, http://www.elmi.com




-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.