HELLO INTERRUPT SPECIALISTS.
DOES ANYONE KNOW HOW TO USE MORE THEN 3 INTERRUPTS ON THE 18F4455? I SAW IN THE HELP FILE IT IS POSSIBLE TO USE RB0,RB1, AND
RB2 AS INTERRUPTS. BUT THERE IS ALSO A PORT FUNCTION . IS IT POSSIBLE TO CONFIGURE FOR EXAMPLE RB4 AS AN INTERRUPT PIN, AND HOW CAN I DO THIS THAN?
CAN SOMEBODY HELP ME BY USING MORE THEN 3 INTERRUPTS?
THANKS
PUTS_JO
MORE INTERRUPTS THAN 3 PINS ?
- 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: MORE INTERRUPTS THAN 3 PINS ?
Hello,
If you look at section 9.9 of the device datasheet then this details the PortB Interrupt on change. This enables an interrupt that will fire if any of the inputs on the upper half of PortB change. Once the interrupt has fired you can read the port and compare with a variable containing the last read to work out which pin has changed. Therefore RB3 is the only pin of PortB that cannot be made into an interrupt.
If you look at section 9.9 of the device datasheet then this details the PortB Interrupt on change. This enables an interrupt that will fire if any of the inputs on the upper half of PortB change. Once the interrupt has fired you can read the port and compare with a variable containing the last read to work out which pin has changed. Therefore RB3 is the only pin of PortB that cannot be made into an interrupt.
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
Re: MORE INTERRUPTS THAN 3 PINS ?
BEST BENJ
How can i read my port B4 after an interrupt has passed on it ? do i have to write a little c program? can you put me on the road for programming it and exclude only port B4?
Thanks.
PUTS_JO
How can i read my port B4 after an interrupt has passed on it ? do i have to write a little c program? can you put me on the road for programming it and exclude only port B4?
Thanks.
PUTS_JO
- 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: MORE INTERRUPTS THAN 3 PINS ?
Hello,
At the start of the interrup macro you would read the port compare with a variable. This would start at 0 when your program starts. Once you have compared with the variable and found out which bit is different you can save the port value into the variable for use next time around the loop.
I know there are good Flowcode examples available already on the forum. I would have made you a small Flowcode example but you are not posting in the Flowcode area of the forums so I assume you are using C or assembly.
At the start of the interrup macro you would read the port compare with a variable. This would start at 0 when your program starts. Once you have compared with the variable and found out which bit is different you can save the port value into the variable for use next time around the loop.
I know there are good Flowcode examples available already on the forum. I would have made you a small Flowcode example but you are not posting in the Flowcode area of the forums so I assume you are using C or assembly.
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
Re: MORE INTERRUPTS THAN 3 PINS ?
BEST BENJ,
Thanks for your reply
MY PROGRAM NEEDS TO LEVEL BETWEEN 2 SETPOINTS
I am using flowcode 4 ;my program is just for changing a value that is on a display without a keyboard panel;i have 4 buttons a setup ;a plus;a minus and a store button . but i have only 3 interrupt buttons to immediately change ;so i send you my program in flowcode4 in attachment.
Maybe there is a better solution to change parameters on a 4line display?
kind regards
PUTS_JO
Thanks for your reply
MY PROGRAM NEEDS TO LEVEL BETWEEN 2 SETPOINTS
I am using flowcode 4 ;my program is just for changing a value that is on a display without a keyboard panel;i have 4 buttons a setup ;a plus;a minus and a store button . but i have only 3 interrupt buttons to immediately change ;so i send you my program in flowcode4 in attachment.
Maybe there is a better solution to change parameters on a 4line display?
kind regards
PUTS_JO
- Attachments
-
- HAAGSCHAARLEVEL3.fcf
- (21.48 KiB) Downloaded 321 times
- 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: MORE INTERRUPTS THAN 3 PINS ?
Hello,
Sorry but I cant answer Flowcode 4 questions outside of the v4 forum topic.
Sorry but I cant answer Flowcode 4 questions outside of the v4 forum topic.
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