usb got disconnected as pin attached with PC Fan speed wire

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
fkpwolf
Posts: 2
Joined: Mon Jan 30, 2012 2:25 pm

usb got disconnected as pin attached with PC Fan speed wire

Post by fkpwolf » Mon Jan 30, 2012 4:10 pm

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?

fkpwolf
Posts: 2
Joined: Mon Jan 30, 2012 2:25 pm

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

Post by fkpwolf » Thu Feb 02, 2012 11:05 am

ok. I found I need a pull-up resistor after several night debug...

Post Reply