Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: superchiku on March 12, 2008, 07:03:35 AM

Title: strange pwm problem
Post by: superchiku on March 12, 2008, 07:03:35 AM
i hope my bot would start working it has got a strange probelm in pwm ,

when it is tested with only the mcu in the breadboard , i get exactly same values of pwm but when used in the bot one is lower than the other i dont know why this is happening can u help

and yes  both of my adc configurations are same so their corresponding pwm must be same so wat is the problem

mcu:atmega16
pwm channel used:oc0 and oc2
same prescaler and values

ADC:reference is AVCC and i have connected capacitor between aref and GND???



Title: Re: strange pwm problem
Post by: HDL_CinC_Dragon on March 12, 2008, 02:25:17 PM
electrolytic or mylar capacitor?
Title: Re: strange pwm problem
Post by: superchiku on March 12, 2008, 02:36:32 PM
mica capacitor electrolytic would just blow up
Title: Re: strange pwm problem
Post by: superchiku on March 12, 2008, 02:38:35 PM
it works on the breadboard but on the main crcuit board it just gets mad doing strange things with pwm

and yes i have triple checked the connections
Title: Re: strange pwm problem
Post by: ed1380 on March 12, 2008, 02:53:31 PM
what is this main circuit board you're talking about? is it through hole, custom made pcb? etc.
Title: Re: strange pwm problem
Post by: superchiku on March 14, 2008, 06:49:17 AM
main circuit board means the veroboard which is going to be attached to the bots
Title: Re: strange pwm problem
Post by: Admin on March 15, 2008, 07:00:59 PM
Quote
and yes  both of my adc configurations are same so their corresponding pwm must be same so wat is the problem
Is your ADC somehow controlling the PWM?

Quote
mica capacitor electrolytic would just blow up
your cap isn't rated at the right voltage

Quote
ADC:reference is AVCC and i have connected capacitor between aref and GND???
yeap, you need a cap there too
Title: Re: strange pwm problem
Post by: superchiku on March 16, 2008, 01:06:15 AM
thanks for the reply i found out the problem since iam using 2 different timers ,they are acting differently when connected to the veroboard i have adjusted the code accordingly and soon will be posting my bot's video