Hello,
I did a post some time back about interrupts not working and i thought it was
fixed....but alas it seems not so.
I have attached sample file, which simply turns uart1/2 interrupts on
and echoes the chars back out the same ports....not working.
Using latest FC6 vers6.1.3.2
Processor is 18F25K22 @ 16mhz internal
SPI initialize is also using CS on unused pins, so no conflict on uart2 tx/rx lines.
Pretty much stumped!
Interrupts not working
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: Interrupts not working
Hi Mark,
How confident are you that the chip is running at the right speed? Have you done the 1 second flasher test to double check?
http://www.matrixtsl.com/wiki/index.php ... ED_flasher
Inside the COMx_INT macros the timeout param for the ReceiveChar macro can be set to 0 but I don't see this having any adverse effects how you have it now.
The C code looks fine so I don't think it's a FCD related issue and your config settings also look fine.
If you send a byte through one of the UARTs then can you receive it correctly? This would confirm that the device is running at the right speed and the baud calc is as expected.
How confident are you that the chip is running at the right speed? Have you done the 1 second flasher test to double check?
http://www.matrixtsl.com/wiki/index.php ... ED_flasher
Inside the COMx_INT macros the timeout param for the ReceiveChar macro can be set to 0 but I don't see this having any adverse effects how you have it now.
The C code looks fine so I don't think it's a FCD related issue and your config settings also look fine.
If you send a byte through one of the UARTs then can you receive it correctly? This would confirm that the device is running at the right speed and the baud calc is as expected.
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
-
- Flowcode v5 User
- Posts: 118
- Joined: Thu Sep 17, 2009 1:30 pm
- Has thanked: 3 times
- Been thanked: 11 times
- Contact:
Re: Interrupts not working
Hi Ben,
I am totally sure about the internal osc settings etc....i use exactly the same on
another larger program on a device....the led flasher is my standard sanity check.
Also at 9600 that baud rate is very manageable at 16mhz clock rate.
i did discover that if i put the int enable icon into a macro program instead
of the main loop it works, but also very picky about where u place it, it doesnt
always work, i know this from my larger program....that was on V6.1.2.0
The latest version just flat refuses to work....
As you can see, the test file is very small...and i use this method often to sanity
check comms on various programs. The FC V5 never had this problem, in fact
it took pretty much anything you threw at it. I think there is a problem with the
flowchart to C parser, because on FC V5 it also uses the boostC compiler without
issues.
Is there anyway u can test this on a board with a 18F25K22 on board?
Maybe i should also try it out on another processor as well to see what it
does then
I am totally sure about the internal osc settings etc....i use exactly the same on
another larger program on a device....the led flasher is my standard sanity check.
Also at 9600 that baud rate is very manageable at 16mhz clock rate.
i did discover that if i put the int enable icon into a macro program instead
of the main loop it works, but also very picky about where u place it, it doesnt
always work, i know this from my larger program....that was on V6.1.2.0
The latest version just flat refuses to work....
As you can see, the test file is very small...and i use this method often to sanity
check comms on various programs. The FC V5 never had this problem, in fact
it took pretty much anything you threw at it. I think there is a problem with the
flowchart to C parser, because on FC V5 it also uses the boostC compiler without
issues.
Is there anyway u can test this on a board with a 18F25K22 on board?
Maybe i should also try it out on another processor as well to see what it
does then
-
- Flowcode v5 User
- Posts: 118
- Joined: Thu Sep 17, 2009 1:30 pm
- Has thanked: 3 times
- Been thanked: 11 times
- Contact:
Re: Interrupts not working
Hi Ben,
It might also be an idea in future releases of V6 to have the option of
selecting no chip selects for the SPI properties, currently i need to assign
the fram etc cs to an unused port...bit clumsy.
It might also be an idea in future releases of V6 to have the option of
selecting no chip selects for the SPI properties, currently i need to assign
the fram etc cs to an unused port...bit clumsy.
- 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: Interrupts not working
Hi Mark,
There should currently be two versions of the SPI master component.
The "SPI Master" listed under the Comms category should not have the CS pins for the Fram etc.
The "SPI Master (EB013)" listed under search has the extra bits and pieces for the EB013 specific hardware. This used to be the main component but has been changed for a while now.
There should currently be two versions of the SPI master component.
The "SPI Master" listed under the Comms category should not have the CS pins for the Fram etc.
The "SPI Master (EB013)" listed under search has the extra bits and pieces for the EB013 specific hardware. This used to be the main component but has been changed for a while now.
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
-
- Flowcode v5 User
- Posts: 118
- Joined: Thu Sep 17, 2009 1:30 pm
- Has thanked: 3 times
- Been thanked: 11 times
- Contact:
Re: Interrupts not working
Hi Ben,
I see now that there is another SPI item in the search part, that seems to
not have the CS options, thanx for the headsup
Back to the interrupt issue, can you not see anything yet as to whats
going on? I know its a crummy thing to tack down but i would like to
see whats going on....
Thanx
Mark
I see now that there is another SPI item in the search part, that seems to
not have the CS options, thanx for the headsup
Back to the interrupt issue, can you not see anything yet as to whats
going on? I know its a crummy thing to tack down but i would like to
see whats going on....
Thanx
Mark
-
- Flowcode v5 User
- Posts: 118
- Joined: Thu Sep 17, 2009 1:30 pm
- Has thanked: 3 times
- Been thanked: 11 times
- Contact:
Re: Interrupts not working
Hi Ben,
Can you please provide some solution to this interrupt problem?
This issue is still not resolved![Sad :(](./images/smilies/icon_sad.gif)
Can you please provide some solution to this interrupt problem?
This issue is still not resolved
![Sad :(](./images/smilies/icon_sad.gif)
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Interrupts not working
Hi,
I've just tested your FA_INT_Test program on a device and found that it locks up.
This is because of a typo in your C code, which is enabling other interrupts
With above change the UART interrupt works OK and I get the echo.
Regards,
Leigh
I've just tested your FA_INT_Test program on a device and found that it locks up.
This is because of a typo in your C code, which is enabling other interrupts
Code: Select all
//intcon2 = 00000101b;
Regards,
Leigh
-
- Flowcode v5 User
- Posts: 118
- Joined: Thu Sep 17, 2009 1:30 pm
- Has thanked: 3 times
- Been thanked: 11 times
- Contact:
Re: Interrupts not working
Hi Leigh
Thanx for taking a look....appreciate
But, i am not sure what the typo is, as intcon2 is
only about enabling pullups and the method of
interrupt triggers (rising/falling edges), nothing
about enabling interrupts themselves....
REGISTER 9-2: INTCON2: INTERRUPT CONTROL 2 REGISTER
R/W-1 R/W-1 R/W-1 R/W-1 U-0 R/W-1 U-0 R/W-1
RBPU INTEDG0 INTEDG1 INTEDG2 — TMR0IP — RBIP
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7 RBPU: PORTB Pull-up Enable bit
1 = All PORTB pull-ups are disabled
0 = PORTB pull-ups are enabled provided that the pin is an input and the corresponding WPUB bit is
set.
bit 6 INTEDG0: External Interrupt 0 Edge Select bit
1 = Interrupt on rising edge
0 = Interrupt on falling edge
bit 5 INTEDG1: External Interrupt 1 Edge Select bit
1 = Interrupt on rising edge
0 = Interrupt on falling edge
bit 4 INTEDG2: External Interrupt 2 Edge Select bit
1 = Interrupt on rising edge
0 = Interrupt on falling edge
bit 3 Unimplemented: Read as ‘0’
bit 2 TMR0IP: TMR0 Overflow Interrupt Priority bit
1 = High priority
0 = Low priority
bit 1 Unimplemented: Read as ‘0’
bit 0 RBIP: RB Port Change Interrupt Priority bit
1 = High priority
0 = Low priority
Thanx for taking a look....appreciate
But, i am not sure what the typo is, as intcon2 is
only about enabling pullups and the method of
interrupt triggers (rising/falling edges), nothing
about enabling interrupts themselves....
REGISTER 9-2: INTCON2: INTERRUPT CONTROL 2 REGISTER
R/W-1 R/W-1 R/W-1 R/W-1 U-0 R/W-1 U-0 R/W-1
RBPU INTEDG0 INTEDG1 INTEDG2 — TMR0IP — RBIP
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7 RBPU: PORTB Pull-up Enable bit
1 = All PORTB pull-ups are disabled
0 = PORTB pull-ups are enabled provided that the pin is an input and the corresponding WPUB bit is
set.
bit 6 INTEDG0: External Interrupt 0 Edge Select bit
1 = Interrupt on rising edge
0 = Interrupt on falling edge
bit 5 INTEDG1: External Interrupt 1 Edge Select bit
1 = Interrupt on rising edge
0 = Interrupt on falling edge
bit 4 INTEDG2: External Interrupt 2 Edge Select bit
1 = Interrupt on rising edge
0 = Interrupt on falling edge
bit 3 Unimplemented: Read as ‘0’
bit 2 TMR0IP: TMR0 Overflow Interrupt Priority bit
1 = High priority
0 = Low priority
bit 1 Unimplemented: Read as ‘0’
bit 0 RBIP: RB Port Change Interrupt Priority bit
1 = High priority
0 = Low priority