I have what I hope is a simple question pertaining to the Atmel AVR microcontrollers. So I want to use the ATTiny85's Analog Comparator to determine if a signal is above or below a threshold. This signal is normally "floating" and pulled toward ground when "active" (i.e. it's an active low - open collector signal). If I enable the pullup on the input pin (which is also the comparator input) by doing:
DDRB = 0x00; // DDRB.1 = 0 = input
PORTB = 0xFF; // PORTB.1 = 1 = internal pullup enabled
If i use the analog comparator and select PORTB.1 as AIN1 will the internal pullup be applied to my input signal? I'm hoping someone has personal experience to verify this behavior. Hope this question isn't too 'hardware-oriented' for stack-overflow. Thanks!
EDIT In response to some of the comments below to the effect of "why not treat it digitially", it's because my "signal" is generated by a sensor (namely an optical IR sensor). I can't be assured that it will pull down "hard enough" to be interpretted as a zero digitally, so I'm going to use the internal 2.56V reference as my switching threshold. I'm just trying to pick up the "IR event," so this seemed the simplest way to me.
Also, by using the analog comparator, I can detect the event "asynchronously" using an ISR. Granted some of the pins can invoke an interrupt on a digital edge, but the one don't want to rely on the response to dip below V_IL.