PDA

View Full Version : DT interrupts - High to Low



mpardinho
- 26th November 2008, 22:07
the code works, but _B0 is started then PORTB.2 Low to High,
i need High to Low


i tryed
DEFINE LVDINT = PORTB.2
and
DEFINE HLVDINT = PORTB.2

but not work




Button var PORTB.2

ASM
INT_LIST macro ;IntSource, Label, Type, ResetFlag?
INT_Handler INT2_INT, _B2, Asm, Yes
INT_Handler RX_INT, _Rx, Asm, Yes
Endm

INT_CREATE
INT_ENABLE INT2_INT
INT_ENABLE RX_INT
ENDASM

.....

B2:
IF Button = 0 then
hserout["0"]
else
hserout["1"]
endif
Fim:
@ INT_RETURN


Rx:
hserout["Rx"]
Fim:
@ INT_RETURN

HenrikOlsson
- 27th November 2008, 05:41
Hi,
I'm not sure I understand what you mean, you mean you want the INT2 interrupt to trig on the falling edge of PortB.2?

Anyway, one problem might be that you declare the ISRs as ASM but then you write them in BASIC. It will also be easier for people to help you if you tell us which PIC you're using.

/Henrik.

mpardinho
- 27th November 2008, 12:28
many thanks.....


i used
INTCON2.4 = 0 ' PORTB.2 - Lo to Hi
and works 100%