View previous topic :: View next topic |
Author |
Message |
colin382
Joined: 03 Jun 2020 Posts: 40 Location: UK
|
#INT_EXT_H2L problem PIC12F1822 |
Posted: Tue Mar 04, 2025 4:51 am |
|
|
Trying to create an external interrupt that will fire on a high-to-low transition
using compiler version 5.105.12.10
#include <12F1822.h>
This compiles:
#INT_EXT
void command_rx(){
output_toggle(PIN_A2);
}
This doesn't, gives "Invalid Pre-Processor directive" error:
#INT_EXT_H2L // copied from 12F1822.h
void command_rx(){
output_toggle(PIN_A2);
}
Do I need to declare the pin for which the interrupt applies? If so, how? |
|
 |
colin382
Joined: 03 Jun 2020 Posts: 40 Location: UK
|
|
Posted: Tue Mar 04, 2025 4:57 am |
|
|
PS
#INT_IOC_A1_H2L doesn't work either! |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19730
|
|
Posted: Tue Mar 04, 2025 5:05 am |
|
|
Understand the difference between the physical interrupt, and the
programming commands.
The interrupt is still INT_EXT.
The H2L instruction, is for use when enabling the interrupt and disabling
it, and what it does is program INT_EXT, to trigger on the specified
condition.
So your do not use INT_EXT_H2L as the interrupt. It isn't. You only use
this in the command to enable/disable the interrupt. |
|
 |
colin382
Joined: 03 Jun 2020 Posts: 40 Location: UK
|
|
Posted: Thu Mar 06, 2025 7:08 am |
|
|
Thanks Ttelmah, helpful as always. All working now. |
|
 |
|