pilar
Joined: 30 Jan 2008 Posts: 197
|
Problem between #INT_EXT and #INT_RB |
Posted: Wed Feb 05, 2014 7:05 pm |
|
|
Hi, anyone can help me with this,
I'm trying to use the #INT_EXT and #INT_RB but each with different edge on which the edge interrupt should trigger, #INT_EXT is rise edge (L to H) and #INT_RB is fall edge (H to L), but when two interrupts are enabled #INT_EXT only active with fall edge, but when I disable #INT_RB, #INT_EXT works OK, it is activated by the rising edge ... what is the problem?
Here is my code:
Code: | #include <18F4520.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,NOBROWNOUT
#use delay(clock=20000000)
#use rs232(baud=19200, xmit=PIN_C6, rcv=PIN_C7, timeout=5000)// RS232 Estándar
int Clear_PORTB;
#INT_EXT
void Int_CALL(){
output_toggle(PIN_D0);
}
#INT_RB
void Int_DOOR(){
output_toggle(PIN_D3);
Clear_PORTB = input_b();
}
void main() {
ext_int_edge(L_TO_H);
clear_interrupt(INT_EXT);
enable_interrupts(int_ext);
ext_int_edge( H_TO_L );
clear_interrupt(INT_RB);
enable_interrupts(int_rb);
enable_interrupts(global);
while(TRUE) {
delay_ms(100);
}
} |
|
|