PDA

View Full Version : Interrupt on PORTB.6



SKOLS1
- 21st April 2012, 19:53
Is there any way to make an interrupt on PORTB.6?I use a transistor as switch to trigger the PORTB.6 to "0" and Pull-up on this PORT,with OPTION_REG.7=0
And I want to use Interrupt,because this code doesn't work:
Proveri:
IF Termos = 0 Then
Relay_flag = 0:LCDOUT $FE, 1:LCDOUT $FE, 1, " Alarm vklucen ":LCDOUT $FE, $c0, $01
ENDIF
High Buzzer
Pause 350
Low Buzzer
Return

Ramius
- 21st April 2012, 21:07
Hi Slos1!
You may consider using an "opto-isolator" such as the NTE3086 and a 10K pull-up resistor. Basically you have on one side of this chip an LED and the other side the collector-emitter junction. This way you can pretty much use just about anything to turn on the internal LED of the chip or if you are a "visual" person you can even add an external LED to see that everything is going to plan. The external 10k resistor will ensure that you will have a high (+5v). Basic wiring is the 10K to +5v to the collector of the 3086 and the juction of the 10K and the chip to your PIC pin. The emitter goes to ground. There is an additional advantage and that is that there are 2 seperate circuits in the chip so if your find the need for a second "switch" you already have one! Hope this helps. Best, Ed