Society of Robots - Robot Forum

Software => Software => Topic started by: totalis on November 03, 2010, 03:51:17 PM

Title: PWM question
Post by: totalis on November 03, 2010, 03:51:17 PM
I hve been using software PWM with alot of success, however i cannot get the same results using hardware PWM. i have tried several different methods, with both Webbotlib and Admins code. I have even tried using the Webbot Project Designed with my own custom board file.  When using the designer, it will only allow me to select either pins B1 or B2 for hardware PWM output, both of which are in use as indicator LED's.

Here is board file
http://dl.dropbox.com/u/5224931/GregDuino.brd (http://dl.dropbox.com/u/5224931/GregDuino.brd)
and Project file
http://dl.dropbox.com/u/5224931/GregDuino.prj (http://dl.dropbox.com/u/5224931/GregDuino.prj)


Any help is appreciated

T
Title: Re: PWM question
Post by: Webbot on November 03, 2010, 06:02:13 PM
Guess you're trying to use hardware PWM for servos - in which case it needs a 16 bit timer. On the ATMega168 that means Timer1 on output pins B1 and B2. The other timers are only 8 bit.
Nothing WebbotLib can do about that - thats what the hardware dictates
Title: Re: PWM question
Post by: totalis on November 04, 2010, 02:55:32 PM
Webbot, that was everything i needed to know! as always you have been very helpful :)

Thank you once again

T