Hi
I have some problems with my little project that contains attiny85 microcontroller. I can't get attiny85 to work properly
. It seems like the clock runs somehow to slow.
If I write a very simple code (I write in Atmel Srudio 6.1) that togles led on the output (1000ms on, 1000ms off) it stays on and off for about 9 seconds. This test program uses util/delay.h with defined F_CPU (I'll post the code below). Also a program I downloaded seems to work just fine but about 9 times to slow.
I was playing with fuses, tried everything but....doesn't work... Same thing with external crystal oscilator. I tried with attiny45 but it does the same thing. The code I wrote works prfectly on atmega32 with internal RC oscilators and external crystal.
I need to get attiny microcontrollers working but I don't know what to do ,so a little help would come handy
What am I doing wrong?
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void){
DDRB = 0b11111111;
PORTB = 0b11111111;
while(1){
PORTB = 0b00000000;
_delay_ms(1000);
PORTB = 0b11111111;
_delay_ms(1000);
}
}