Page 1 of 1

Servo problems

Posted: Wed May 02, 2012 11:15 pm
by TomasS
Hi

I have done some small different test programs in Flowcode for AVR V4 - but only tested them in the program. Now I tried to download this very simple test program - the only function is, that it should make the 180 degree servo go back and forward.
When I download the program with a servo connected to pin A0 the servo do a little move back and forward when the download has completed, but that's all. I have tried changing the delay up and down, but the doesn't seem to have any effect at all.

What am I doing wrong?

I use a STK500 on an ATmega16 controller.

BR.
Tomas

Re: Servo problems

Posted: Thu May 03, 2012 10:05 am
by Benj
Hello Tomas,

Have you confirmed that the device is running at the speed you are expecting by performing a one second flasher test? I think AVR's come factory programmed with a divide by 8 prescaler on the clock so you have to change the config to get them to work at the correct speed.

Maybe also try the setposition macro rather then the move to position macro.

Re: Servo problems

Posted: Thu May 03, 2012 4:31 pm
by TomasS
Benj wrote:Hello Tomas,

Have you confirmed that the device is running at the speed you are expecting by performing a one second flasher test? I think AVR's come factory programmed with a divide by 8 prescaler on the clock so you have to change the config to get them to work at the correct speed.

Maybe also try the setposition macro rather then the move to position macro.
Hi Ben

SUCCESS!

I just forgot to change the speed to 4MHz - doh! ;)

Thanks!

BR
Tomas