I have ATTiny85 that I want to drive a servo. Burned bootloader to the ATTiny85 and I am using HW-260 development board to program and to test the code. While the ATTiny85 works perfectly on the HW-260 development board, I cant get it to work as a standalone on a breadboard when testing with the servo by using the Adafruit_SoftServo library and with the blink example. Tried adding 4.7kOhm pull-up resistor to PB5 to prevent the ATTiny85 from resetting but I get the same result. Tried powering the standalone layout with 3V coin cell, USB 5V, powerbank 5V and nothing. This is the servo code I am using:
Adafruit_SoftServo myservo;
int pos = 0;
void setup() {
myservo.attach(PB0);
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) {
myservo.write(pos);
myservo.refresh();
delay(15);
}
for (pos = 180; pos >= 0; pos -= 1) {
myservo.write(pos);
myservo.refresh();
delay(15);
}
}
The blink code I am using is from the examples, I just change the output pin as PB1. If I connect the PB5 briefly to ground, I get the servo to turn a bit in random direction. Measured and the breadboard is not the problem, everything seems to be connected correctly.
This is the bootloader I used https://github.com/ashishchoudhary9998/ATtiny85-Boot-loader