External interupts not working
Moderator: Benj
External interupts not working
Hello,
I am working with the PIC18F45Q10 Micro.
Using External Interrupts INT0 and INT1
The data sheet shows that these are Remappable pins to any PortA or PortB location.
I don't see anywhere to select the pins so I am using the default locations RB0 and RB1 and have an active High switch connected to each.
Flowcode (V8.2.2.15) seems to recognize this setup and simulates correctly.
I compile to Hex (no errors) and program with PicKit3 (attached to EB006V9) with no problems.
When running the hardware the chip does not vector to the interrupt macro when the external switches are engaged.
Hardware is EB006V9 and EB083 I/O brd.
Any thoughts would be appreciated.
Thanks,
Dave
I am working with the PIC18F45Q10 Micro.
Using External Interrupts INT0 and INT1
The data sheet shows that these are Remappable pins to any PortA or PortB location.
I don't see anywhere to select the pins so I am using the default locations RB0 and RB1 and have an active High switch connected to each.
Flowcode (V8.2.2.15) seems to recognize this setup and simulates correctly.
I compile to Hex (no errors) and program with PicKit3 (attached to EB006V9) with no problems.
When running the hardware the chip does not vector to the interrupt macro when the external switches are engaged.
Hardware is EB006V9 and EB083 I/O brd.
Any thoughts would be appreciated.
Thanks,
Dave
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: External interupts not working
Hi Dave,
I have moved your topic to the bugs section as I agree there are issues with the interrupt.
For the selection of INT0 remapable pins, I have temporarily attempted to fix it.
Not sure if will work correctly in hardware or not as not an expert with Fcdx files.
Can you place the attached file in C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC folder.
The folder is hidden by default.
Reload Flowchart and hopefully you will be able to select different pins?
Not addressed IOC.
I have moved your topic to the bugs section as I agree there are issues with the interrupt.
For the selection of INT0 remapable pins, I have temporarily attempted to fix it.
Not sure if will work correctly in hardware or not as not an expert with Fcdx files.
Can you place the attached file in C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC folder.
The folder is hidden by default.
Reload Flowchart and hopefully you will be able to select different pins?
Not addressed IOC.
- Attachments
-
- 18F45Q10.fcdx
- (42.89 KiB) Downloaded 223 times
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: External interupts not working
OK nps.
If not working, can you please make sure1 second flash test is working OK?
If not working, can you please make sure1 second flash test is working OK?
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: External interupts not working
Hi Dave,
Your welcome.
Try this unofficial fix.
Your welcome.
That is good news.dz28 wrote:Good news INT0 seems to now work!!
Try this unofficial fix.
- Attachments
-
- 18F45Q10.fcdx
- (45.51 KiB) Downloaded 218 times
Martin
Re: External interupts not working
I had a chance to play with this a bit now.
INT0 seems to work OK by itself.
INT1 by itself or along with INT0 is very erratic.
Sometimes triggering sometimes not.
If I add a tMR0 interrupt to the mix things get worst.
I think there is more going on here.
Let me know if you want me to try anything specific to help debug this.
Thanks,
Dave
INT0 seems to work OK by itself.
INT1 by itself or along with INT0 is very erratic.
Sometimes triggering sometimes not.
If I add a tMR0 interrupt to the mix things get worst.
I think there is more going on here.
Let me know if you want me to try anything specific to help debug this.
Thanks,
Dave
- 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: External interupts not working
Hi Dave,
Is the signal going to the INT1 pin at full VCC and VSS voltage? Also is the rise/fall time nice and fast, we have seen unexpected things when using capacative type signals.
H Martin,
Thanks for the fix to the FCD. I've checked the datasheet and your solution looks good to me so I've applied this fix to the rest of the family.
Is the signal going to the INT1 pin at full VCC and VSS voltage? Also is the rise/fall time nice and fast, we have seen unexpected things when using capacative type signals.
H Martin,
Thanks for the fix to the FCD. I've checked the datasheet and your solution looks good to me so I've applied this fix to the rest of the family.
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: External interupts not working
The signals look good.
I am using Eblocks boards EB083 and EB006V9
Programming with PicKit3 plugged into the EB006V9
The Switch signals do fall short of 5V only swinging to 3.1V at the PIC
EB083 is unmodified.
Weird thing is that if I write a program to toogle an LED every 1 sec in the TMR0 interupt routine everything works fine.
If I add INT0 and a switch on RB0. The LED flashing becomes erratic. This happens with the INT0 switch untouched and RB0 sitting at Ground.
I will mod the EB083 board so it switches to 5V.
Thanks
Dave
I am using Eblocks boards EB083 and EB006V9
Programming with PicKit3 plugged into the EB006V9
The Switch signals do fall short of 5V only swinging to 3.1V at the PIC
EB083 is unmodified.
Weird thing is that if I write a program to toogle an LED every 1 sec in the TMR0 interupt routine everything works fine.
If I add INT0 and a switch on RB0. The LED flashing becomes erratic. This happens with the INT0 switch untouched and RB0 sitting at Ground.
I will mod the EB083 board so it switches to 5V.
Thanks
Dave
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: External interupts not working
Can you post a flowchart that has the issues you have described?
Martin
Re: External interupts not working
Martin,
Attached are 2 flowcharts
Both simulate fine in flowcode.
"Test2" seems to work fine programmed to hardware.
"LED_Flash" adds some minor complexity to the interrupt routines and main loop.
The TMR0 led flash struggles to stay in sync when programmed to hardware.
Could be some type of programming error that causes a conflict on the portA outputs?
Thanks,
Dave
Attached are 2 flowcharts
Both simulate fine in flowcode.
"Test2" seems to work fine programmed to hardware.
"LED_Flash" adds some minor complexity to the interrupt routines and main loop.
The TMR0 led flash struggles to stay in sync when programmed to hardware.
Could be some type of programming error that causes a conflict on the portA outputs?
Thanks,
Dave
- Attachments
-
- Test2.fcfx
- (14.04 KiB) Downloaded 205 times
-
- LED_Flash.fcfx
- (19.16 KiB) Downloaded 194 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: External interupts not working
Not sure if will make a difference or not.
Can you try with a basic port output instead of Led_5mm turn on/off?
Can you try with a basic port output instead of Led_5mm turn on/off?
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: External interupts not working
Ahh, that's good.dz28 wrote:Moved the TMR0 LED to PORTB and it seems happy now.
I did suspect that the same component within different interrupts could cause an adverse affect.
Just was not 100% sure where LED components are concerned.
Glad its now working as expected.
Martin