This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions,
flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.
pwm_init - Antonio Parziale - May 24 17:08:22 2008
hi to everyone,
i'm using pwm_init() function for setting frequence of a PWM signal created by a
RCM3700
i wrote:
main()
{
unsigned long freq;
freq = pwm_init(xxx);
pwm_set(1, 0.5*1024, PWM_SPREAD);
}
If xxx is an unisgned long minus or equal to 5400 it's all ok: RCM procudes a PWM signal
with xxx frequence or (xxx)*4 if i used PWM_SPREAD in pwm_set()
If xxx is an unsigned long more of 5400 RCM produces a PWM signal with a frequence of
10,8 kHz or 43,2 kHZ if i used PWM_SPREAD in pwm_set()
Why can't i produce a frequence between 5,4 kHz to 10 kHz??
thanks
Antonio

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )
Re: pwm_init - mehiegl - May 24 19:07:56 2008
You are up against the limited resolution of the PWM and Timer A9.
The RCM3700 has a 22118400 Hz clock, divided by 2 for the pclk, and
divided by 1024 for the 10-bit PWM register, you get the max PWM
frequency of 10,800 Hz without the spreading function.
The frequency is lowered further by prescaling with Timer A9. The
first increment of is a divide by 2, and you get 5400 Hz.
Mark
--- In r...@yahoogroups.com, "Antonio Parziale"
wrote:
>
> hi to everyone,
>
> i'm using pwm_init() function for setting frequence of a PWM signal
created by a RCM3700
>
> i wrote:
>
> main()
> {
> unsigned long freq;
>
> freq = pwm_init(xxx);
>
> pwm_set(1, 0.5*1024, PWM_SPREAD);
>
> }
> If xxx is an unisgned long minus or equal to 5400 it's all ok: RCM
procudes a PWM signal with xxx frequence or (xxx)*4 if i used
PWM_SPREAD in pwm_set()
>
> If xxx is an unsigned long more of 5400 RCM produces a PWM signal
with a frequence of 10,8 kHz or 43,2 kHZ if i used PWM_SPREAD in
pwm_set()
>
> Why can't i produce a frequence between 5,4 kHz to 10 kHz??
>
> thanks
> Antonio
>
------------------------------------

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )