Page 1 of 1

usb got disconnected as pin attached with PC Fan speed wire

Posted: Mon Jan 30, 2012 4:10 pm
by fkpwolf
my environment: attiny45, default circuits which use internal RC oscillator. So PB5, PB4, PB3 and PB0 are left for own using.

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?

Re: usb got disconnected as pin attached with PC Fan speed wire

Posted: Thu Feb 02, 2012 11:05 am
by fkpwolf
ok. I found I need a pull-up resistor after several night debug...