gumstix-users

 [Gumstix-users] round number robostix PWM frequency From: Chris Sears - 2006-04-23 18:47:31 ```Dave I would like to set my motor PWM frequency to be a multiple of 60 Hz.=20 My controller does sampling and having the motor be a multiple of 60 Hz would simplify the design of the IIR noise filter. Is it possible to trick the Atmel into this? Right now I have 976.5625 Hz and I'd like 960 Hz. thanks Chris ```
 Re: [Gumstix-users] round number robostix PWM frequency From: Dave Hylands - 2006-04-23 19:21:53 ```Hi Chris, > I would like to set my motor PWM frequency to be a multiple of 60 Hz. > My controller does sampling and having the motor be a multiple of 60 > Hz would simplify the design of the IIR noise filter. Is it possible > to trick the Atmel into this? Right now I have 976.5625 Hz and I'd > like 960 Hz. 16,000,000 / 960 =3D 16,666.6667 So you can't get exactly 960 Hz. 16,000,000 / 16667 =3D 959.98 Hz. So using the servo sample, as a base, modifying the prescalar to be divide by 1, and setting the ICRx register to 16666 (there's a +1 according to the datasheet) will give you 959.98 Hz. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ ```
 Re: [Gumstix-users] round number robostix PWM frequency From: Chris Sears - 2006-04-23 23:14:45 ```Dave thanks, 959.98 Hz is definitely close enough. Chris On 4/23/06, Dave Hylands wrote: > Hi Chris, > > > I would like to set my motor PWM frequency to be a multiple of 60 Hz. > > My controller does sampling and having the motor be a multiple of 60 > > Hz would simplify the design of the IIR noise filter. Is it possible > > to trick the Atmel into this? Right now I have 976.5625 Hz and I'd > > like 960 Hz. > > 16,000,000 / 960 =3D 16,666.6667 > > So you can't get exactly 960 Hz. > > 16,000,000 / 16667 =3D 959.98 Hz. > > So using the servo sample, as a base, modifying the prescalar to be > divide by 1, and setting the ICRx register to 16666 (there's a +1 > according to the datasheet) will give you 959.98 Hz. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job ea= sier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmdlnk&kid=120709&bid&3057&dat=121642 > _______________________________________________ > gumstix-users mailing list > gumstix-users@... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > ```