Servo problems

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
TomasS
Posts: 75
Joined: Wed Oct 28, 2009 2:37 pm
Has thanked: 15 times
Been thanked: 1 time
Contact:

Servo problems

Post 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
Attachments
Servotest.fcf_avr
(5.5 KiB) Downloaded 224 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Servo problems

Post 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.

TomasS
Posts: 75
Joined: Wed Oct 28, 2009 2:37 pm
Has thanked: 15 times
Been thanked: 1 time
Contact:

Re: Servo problems

Post 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

Post Reply