Go Down

Topic: attiny 45/85 delay error (Read 578 times) previous topic - next topic

acmiilangr

i have a simple code like this on attiny45/85 mic, using arduino as ISP
Code: [Select]

    digitalWrite(output_CH_A,0);
    delayMicroseconds(900);
    digitalWrite(output_CH_A,1);  
    delayMicroseconds(900);    


it is a simple code that sends small pulses all time

when i am trying to read the width of the pulse (on that pin) from another arduino  (via serial monitor), i get all time 7100-7200 microseconds), that it is wrong

when i am using the same code for arduino 328 or MEGA i get about 900milliseconds as it must be,


why there is this error? how can i fix it?




Grumpy_Mike

Quote
i have a simple code like this on attiny45/85 mic

It sounds like that processor has not been set up correctly, what clock speed is it running at? It is likely that the delayMicroseconds is using the wrong value in the timer to work correctly on your system.

acmiilangr

i dont know, to solve the problem when i need 700microseconds i use 70.
I dont know if that have to do with it's internal clock

Go Up