Luciano
I'm still not having any luck making my interrupts work, they appear to be permanently on but looking over my circuit I may have found my problem and would appreciate another opinion.
I use RB0,1,2 as outputs to drive another chip serially so I am assuming I can use these as outputs and still use RB4:7 as inputs?
My code goes like this (I have just cut n pasted the interrupt bits)
When I scope RB4 it always appears to be at a low level where as RB5:7 are just under 5 Volts? When you use the internal pull-ups I assume volts appear on the appropriate pin? Or am I dragging down RB4 where it's connected to another IC, and this is causing a permanent interrupt?
I have one of the Lab -x3 * x2 boards and was trying to get a working interrupt demo on a 16f628 but I still had no joy.
Sorry to be a pain but all pointers gratefully accepted.
Rob
OPTION_REG = %1111000 ' Enable PORTB pullups
INTCON = %10011000 ' Enable INTE interrupt
On Interrupt Goto NoVideo ' Define interrupt handler
disable
:NoVideo
IF PORTB.4 = 1 then
low PORTC.0 'Green LED (bipolar LED)
high PORTC.1 'Green LED
ENDIF
IF PORTB.4 = 0 then
low PORTC.1 'Red LED
high PORTC.0 'Red LED
NoSync = PORTB.4
ENDIF
'**Interrupts stuff
INTCON.1 = 0 ' Clear interrupt flag
Resume ' Return to main program
Enable
Bookmarks