Hi!
I tried to write interrupts but the code doesn't work on my PIC16F876A:
CCS C-Compiler Code:
The LED on Ra2 should be on for 2 seconds, but it doesn't unfortunately.
By the way putting "void" before "inthdl_ext()" does not affect the result.
cya
i2c2k[/code]
I tried to write interrupts but the code doesn't work on my PIC16F876A:
CCS C-Compiler Code:
Code:
#include <16f876A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
inthdl_ext();
void main() {
SET_TRIS_A ( 0b11111010 );
SET_TRIS_B ( 0b00000001 );
SET_TRIS_C ( 0b00000000 );
enable_interrupts(INT_EXT);
ext_int_edge(H_TO_L);
}
#INT_EXT
inthdl_ext() {
output_bit(PIN_A2, 1);
delay_ms(2000);
output_bit(PIN_A2, 0);
}
The LED on Ra2 should be on for 2 seconds, but it doesn't unfortunately.
By the way putting "void" before "inthdl_ext()" does not affect the result.
cya
i2c2k[/code]