interrupt sensing

Thread Starter

satishkumili

Joined Oct 29, 2008
5
initially i made P3=0;
when am giving high i/p(+5v from power supply) the interrupt pin is responding( it is showing +5v on this pin
if i give +5v through optocoupler the voltage on pin becomes 0v instead of +5v .
why it is happening?
optocoupler is working well.am taking output of optocoupler from emitter.
is there any problem from microcntroller side or intialization?
 

scubasteve_911

Joined Dec 27, 2007
1,203
Typically optocouplings are inverting. So, if you apply the voltage to the LED, it lights up, then causes the transistor in the optocoupler to turn on. When it turns on, it pulls collector to near ground potential (assuming you have a weak enough pullup resistor).

Your microcontroller pin should be set to interrupt on falling edge, or on a low.

Steve
 

Thread Starter

satishkumili

Joined Oct 29, 2008
5
thanx steve for replying
actually i connected optocoupler in propotional mode (am taking o/p from emitter & no resistance in collector, 100k resistyance is in emitter)
so,whenever i/p to opto is high o/p is high & vice versa.
now when i/p is high o/p(at INT1 pin o/p is not becoming high.it is still low only)
why it is happening?
as i intialized P3=0x00; IS this port pin,p3.3 (INT1) is effecting the optocoupler & making INT1 pin low.
 

Thread Starter

satishkumili

Joined Oct 29, 2008
5
dear steve , may be the last posting to you is not clearer.
so,am sending this posting clearly
actually i connected optocoupler in propotional mode (am taking o/p from emitter & no resistance in collector, 100k resistyance is in emitter)
so,whenever i/p to opto is high, o/p of it is high & vice versa.
now consider that optocoupler o/p is connected to INT1.
so,if i/p is high, o/p(at INT1 pin is not becoming high.it is still low only)
why it is happening?
initially, i intialized P3=0x00; IS this port pin,p3.3 (INT1) is effecting the optocoupler & making o/p of optocoupler to low.
 

scubasteve_911

Joined Dec 27, 2007
1,203
Did you test the optocoupler unconnected? If so, then what is the input impedance of your microcontroller? 100K may be too high of a resistor to use, perhaps go a bit lower (1-10K)

Steve
 

Thread Starter

satishkumili

Joined Oct 29, 2008
5
Dear steve,
i have checked the optocoupler o/p without connecting to controller.
with 100k in emitter, o/p is 5v.
but when am connecting it to controller o/p becoming zero
i wll replace dis 100k with 10k and wll inform u.
thanks&Regards
satish
 
Top