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
Servo problems
Moderator: Benj
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 75
- Joined: Wed Oct 28, 2009 2:37 pm
- Has thanked: 15 times
- Been thanked: 1 time
- Contact:
Re: Servo problems
Hi BenBenj 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.
SUCCESS!
I just forgot to change the speed to 4MHz - doh!
Thanks!
BR
Tomas