Go Down

Topic: Beta testers wanted for TinyServo library (Read 45501 times) previous topic - next topic

tylernt

UPDATE: The Zip attached to the first post of this thread has been updated with a bugfix for ATtiny84.

hmeijdam

Thanks !
Very helpfull and instrumental in completing my little project
This worked first time try on a ATTiny85 @ 8MHz. I could not get a stable servo signal @16MHz

Hans
( ͡° ͜ʖ ͡°)

tylernt

Thanks hmeijdam! :)

As for 16Mhz problems, I can only guess that perhaps the "Burn Bootloader" process didn't work to set the fuses.

hmeijdam

#18
Oct 29, 2014, 08:14 pm Last Edit: Oct 29, 2014, 08:42 pm by hmeijdam
Thanks hmeijdam! :)

As for 16Mhz problems, I can only guess that perhaps the "Burn Bootloader" process didn't work to set the fuses.
I double checked again today and setting the fuses (burning bootloader) for 16MHz seems working fine.
I tested this using the blink sketch to check if at both 8MHz and 16MHz it still blinks at a one second rate.
I use exactly the same core and boards.txt files that you described above. I have your library running at 8MHz now and cannot afford to change the core timer, as that is in use for the "manchester" coding datatransmission protocol. This is why I am so keen on getting it to 16Mhz. Better servo resolution with less jitter.

I know that blink is using the core timer, so maybe the timer 1 that I have to use at 16MHz is not properly configured. Did you test 16MHz with both timers?
Below is the code that I use for testing (I also tested your example) and both work fine on 8MHz but on 16MHz the servo moves to maximum end-point and starts humming. I wish I had a scope to see what pulse comes out.
Code: [Select]

/*
Servo connected to Pin 1 and Potmeter to Pin A3

                  ATtiny25/45/85
                      +-\/-+
              RESET  1|    |8  VCC
               3/A3  2|    |7  2/A1
               4/A2  3|    |6  1
                GND  4|    |5  0
                      +----+

*/
int analog1 = A3; //Analog Input

#include <TinyServo.h>
const byte SERVOS = 1; // how many servos do you have? up to 5 on ATTiny85 and 8 on ATtiny84/2313
const byte servoPin[SERVOS] = {1}; // what pins are your servos on?
// you have the option to give your servos nice names. 0 refers to the first servo pin above, 1 to the second, etc
#define SERVO1 0

void setup(){
pinMode(analog1,INPUT);
setupServos();
}

void loop(){
int an = analogRead(analog1);
an = map(an, 0, 1023, 0 , 180 );
moveServo(SERVO1, an);
delay(20); // with or without this delay the result was the same
}



( ͡° ͜ʖ ͡°)

Erni

#19
Oct 30, 2014, 12:21 pm Last Edit: Oct 30, 2014, 12:21 pm by Erni
I just tried the library on ATTiny85 @ 16 MHz.
It worked fine, see the attached screenshot from my logic analyzer.
The pulsewidth is 1 ms


hmeijdam

Thanks for testing Erni. Though now I am completely at a loss what's wrong on my end.
( ͡° ͜ʖ ͡°)

Kafer

Hi, is it possibile to write microseconds instead of angles?
Like the writeMicroseconds() instruction in Servo.h library that doesn't works with ATtiny85.

carfreak

Hi,

Is there an easy way to shutdown the pulses for the servo's ?

so when there is no action required the servo's are shutdown and don't tikkle.

Greetings.

Go Up