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
Custom interrupt on Port A0
Moderator: Benj
- 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: Custom interrupt on Port A0
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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: Custom interrupt on Port A0
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel