View previous topic :: View next topic |
Author |
Message |
sezgin ozan
Joined: 05 Jan 2014 Posts: 17
|
external interrupt at pic16f18176 |
Posted: Tue Jun 17, 2025 2:34 am |
|
|
Hi everybody , I need external interrupt on PIN_A3 at "pc16f18176", does any know how to set, I tried as below at main() but does not work
#INT_EXT
void IR_INT(void) {
UPD6121_InterruptService();
}
enable_interrupts( INT_RA3_H2L );
enable_interrupts(INT_TIMER0);
enable_interrupts(GLOBAL); |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19859
|
|
Posted: Tue Jun 17, 2025 3:45 am |
|
|
Very simple reason. Wrong interrupt.....
INT_EXT, handles the EXT interrupt pin.
The interrupt on change for port A, is INT_RA
Also beware that you have to clear the latch for the change interrupt for the
pin you are using (clear_interrupt), in the handler.
There is a single interrupt (which the compiler handles for you), and then
separate latches for each pin. |
|
 |
sezgin ozan
Joined: 05 Jan 2014 Posts: 17
|
|
Posted: Tue Jun 17, 2025 4:49 am |
|
|
Thank you Ttelmah, I will fix it. |
|
 |
|