I am trying to emulate the behavior of a circuit using an Attiny85
This is the result I got so far:
In the picture above, D2 is VCC, D4, D5 and D6 are outputs of the circuit I am trying to emulate. D7 is the output of Attiny85
The code I am using is:
#define F_CPU 8000000L
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
int main() {
DDRB = 0b00001000;
PORTB = 0b00001000;
_delay_ms(5);
PORTB = 0b00000000;
_delay_ms(5);
PORTB = 0b00001000;
_delay_ms(5);
PORTB = 0b00000000;
_delay_ms(5);
_delay_ms(5);
while(1)
{
PORTB = 0b00001000;
_delay_ms(1);
PORTB = 0b00000000;
_delay_ms(1);
}
return 0;
}
According to this, it takes roughly 64ms from powerup until it actually run the main program.
Is there any reason for such a delay? How can I reduce it somehow (ideally to 20ms or less)?