roby Guest
|
interrupt problem please.... |
Posted: Mon Sep 29, 2008 9:05 am |
|
|
I have problem executing this interrupt for a week:
The PIC is starting MAIN function and then after a few seconds he goes and execute the interrupt while the interrupt pin is low !
Every time again. He starts MAIN, few seconds, and jump to interrupt!
I can't understand what it is. No hardware problem.
If I push the button of the interrupt-he goes and execute him just fine.
But why does he jump to interrupt alone ??
Code: | #include <16F690.h>
#fuses HS,NOWDT,NOPROTECT,put
#use delay(clock=8000000)
#include <stdlib.h>
#int_ext
void int_ext_isr()
{
output_low(pin_b6);
output_high(PIN_C2);//go straight
output_low(PIN_C3);
output_high(PIN_C5);
output_low(PIN_C4);
delay_ms(3000);
}
void main() {
enable_interrupts(global);
enable_interrupts(INT_EXT);
ext_int_edge( L_TO_H );
while(1)
{
output_high(pin_b6);
}
} |
|
|