It works well at most test case. And now I want to use it to monitor common 4pin PC Fan speed. I use Timer 0 overflow interrupt:
Code: Select all
TCCR0B = 0x02;// 1:8 presc.
TCNT0 =0;
TIMSK= 1 << TOIE0; //unmark Timer 0 overflow interrupt
.......
ISR(TIM0_OVF_vect) {......
It is simple. But when fan's speed wire was connected any pin of pb5/pb3/pb0 and then turn on the fan, usb got disconnected. I also tried pin change interrupt, and got same result. Only when I used pb4, usb works steady but input data was always 0.
I curiosity that why only pb4 was working?