UART Interrupt not working (V4.5)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

UART Interrupt not working (V4.5)

Post by Dave S »

Hi,

I can't seem to get the UART interrupt working (see attached code) in V4.5. If I put the IF statement in RxInt into the main loop and don't use the interrupt all works well. Unfortunately I need it to work from the interrupt fot the next stage. I have tried manually setting Intcon, PIE1 and PIR1 to no avail. Any ideas please?

Thanks,

Dave.
RS232Strings.fcf
(11.5 KiB) Downloaded 351 times

User avatar
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: UART Interrupt not working (V4.5)

Post by Benj »

Hi Dave,

Please try adding the following line of code in a C icon at the start of your program and let me know how you get on.

Code: Select all

set_bit(intcon, PEIE);
Edit. Hmm I see your already doing this. The GEIE and RCIE lines of code should not be required and your RxInt macro is incorrect, the C code may not work correctly.

Here is a quick test program for your hardware to see if the interrupt is working at all.
IntTest.fcf
(7.5 KiB) Downloaded 387 times
If still nothing then have you done a 1 second flasher test on the hardware to ensure your clock speed and config is correct?

User avatar
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: UART Interrupt not working (V4.5)

Post by Benj »

Whoops the RxInt macro should set RxRec to 0 not 1.

Dave S
Posts: 39
Joined: Tue Jun 07, 2011 12:37 pm
Has thanked: 12 times
Been thanked: 5 times
Contact:

Re: UART Interrupt not working (V4.5)

Post by Dave S »

Well that works fine Ben. Gives me something to work with.

Thanks,

Dave.

Post Reply