Custom interrupt on Port A0

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

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Custom interrupt on Port A0

Postby Ondra » Thu Feb 10, 2011 1:32 pm

Good day all.
I a have created a program that uses a software USART on port A of a PIC18F2680 chip. I would like to know if it's possible to set an interrupt on the RX pin? In this case its RA0. If it's do-able would you be so kind and provide code or a code sample or point me in the right directions? Thanks in advance.

Ondra

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

Re: Custom interrupt on Port A0

Postby Benj » Fri Feb 11, 2011 10:23 am

Hello Ondra,

The only external interrupts available on that device are:

INT0 - RB0
INT1 - RB1
INT2 - RB2
PORT - RB4-7

One way to trigger an interrupt would be to set a timer running on a low frequency timeout say timer1 and then when you receive your software RS232 value you can write 255 to the timer count register and get it to overflow. Not sure how helpful this would be as the reception would still have to be done in software first using polling techniques.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: Custom interrupt on Port A0

Postby Ondra » Fri Feb 11, 2011 11:49 am

Thanks Benj.

Ondra

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

Re: Custom interrupt on Port A0

Postby Benj » Fri Feb 11, 2011 3:18 pm

Hi Ondra,

Sean has just pointed out to me that there are in fact other external interrupts available but I don't think any of them are on pin A0.

TCKx inputs can be used to generate timer overflow interrupts from an input edge if the timer is pre-set to the roll-over value each time.

CCPx inputs generate interrupts directly.

Comparator inputs.