Using attached Flowchart, not able to get RX interrupt to work on default or alternative settings.
When chars sent at 9600 baud, nothing is detected.
RX INT not working 16F1825[Resolved]
Moderator: Benj
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
RX INT not working 16F1825[Resolved]
- Attachments
-
- RX Int Test1.fcfx
- (13.33 KiB) Downloaded 178 times
Martin
- 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: RX INT not working 16F1825
Hi Martin,
You don't seem to be calling the UART Initialise macro in your program. Hopefully that's the reason it's not working
You don't seem to be calling the UART Initialise macro in your program. Hopefully that's the reason it's not working
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
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RX INT not working 16F1825
Hi Ben,
Thanks & Silly me.
for testing, I deleted initialise program call macro from the main flowchart and that had the initialise UART in.
Then main program which works perfect with ECIO40p8, does not work when migrated to 16F1825.
Issue is with RX not working.
I have double-checked and the initialise UART is definitely there but still not working with RX.
However, after adding initialise UART with the very basic test program, RX does work.
So there is something conflicting in the original program that worked with ECIO40p8
I will PM the flowchart in question.
Thanks & Silly me.
for testing, I deleted initialise program call macro from the main flowchart and that had the initialise UART in.
Then main program which works perfect with ECIO40p8, does not work when migrated to 16F1825.
Issue is with RX not working.
I have double-checked and the initialise UART is definitely there but still not working with RX.
However, after adding initialise UART with the very basic test program, RX does work.
So there is something conflicting in the original program that worked with ECIO40p8
I will PM the flowchart in question.
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RX INT not working 16F1825
Hi Ben,
Worked out the issue.
If RXINT0 is used before UART Initilise, then RX interrupt will not work.
Is this commonly known?
Worked out the issue.
If RXINT0 is used before UART Initilise, then RX interrupt will not work.
Is this commonly known?
Martin
- 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: RX INT not working 16F1825[Resolved]
Hi Martin,
There is code in the CAL UART initialise routine to disable the RX interrupt if not specifically enabled in the CAL component. e.g. for component based RX interrupts such as GPS or ESP8266.
There is code in the CAL UART initialise routine to disable the RX interrupt if not specifically enabled in the CAL component. e.g. for component based RX interrupts such as GPS or ESP8266.
I can't remember why we disable the interrupt if it's not enabled in the CAL. There is likely a reason for it but I can't remember what that might be. Maybe to avoid a lockup if a frame error etc is received?#if (MX_UART_INT_X == 1)
MX_UART_INT_CH1_EN;
st_bit(INTCON, PEIE);
st_bit(INTCON, GIE);
#else
cr_bit (MX_UART1_PIE, RCIE);
#endif
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