Interrupt on 24FJ256

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Interrupt on 24FJ256

Post by Mathy »

Hi !

I need to have some explanation about how interrupt works on these PIC24FJ.

For example, on the 24FJ256GA110, the INT0 seems to be muxed with the 55th pin but which pin I have to use for INT1 and INT2 ?

What about the interrupt on port ? What is the port concerned by this interrupt ?

Thank you for your time.

Mathy

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Interrupt on 24FJ256

Post by Mathy »

Hello,

Any help ?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Interrupt on 24FJ256

Post by Benj »

Hello Mathy,

Sorry for the delay.

The interrupt pins INT1 to INT4 are remappable on this device so you can use any I/O pin marked with RPx on the device datasheet.

Section 10.4 of the device datasheet details this functionality.

INT1 - RPINR0
INT2 - RPINR1
INT3 - RPINR1
INT4 - RPINR2

Here is the C code you would use to assign the RP number to the functionality.

INT1: RPINR0 = (RPINR0 & 0x00FF) | ( x << 8 );
INT2: RPINR1 = (RPINR1 & 0xFF00) | x;
INT3: RPINR1 = (RPINR1 & 0x00FF) | ( x << 8 );
INT4: RPINR1 = (RPINR2 & 0xFF00) | x;

Where x is the RP pin number you wish to assign.

Add the C code using a C code icon before you enable the interrupt.

For the PORT interrupt you have control over which pins can trigger the interrupt. Registers CNEN1 through CNEN6 select which pins are active for the interrupt. Setting a bit in the CNEN register will enable the PORT interrupt for that particular pin. The CN numbers are again available from the diagram on the device datasheet.

Let me know if you have any problems.

Post Reply