CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

#INT_EXT_H2L problem PIC12F1822

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
colin382



Joined: 03 Jun 2020
Posts: 40
Location: UK

View user's profile Send private message

#INT_EXT_H2L problem PIC12F1822
PostPosted: Tue Mar 04, 2025 4:51 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 04, 2025 4:57 am     Reply with quote

PS

#INT_IOC_A1_H2L doesn't work either!
Ttelmah



Joined: 11 Mar 2010
Posts: 19730

View user's profile Send private message

PostPosted: Tue Mar 04, 2025 5:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Mar 06, 2025 7:08 am     Reply with quote

Thanks Ttelmah, helpful as always. All working now.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group