Interrupt on 2 UART

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
Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Interrupt on 2 UART

Post by Mathy »

Hi everybody :)

I have a 18F6527 and I use the two UART. I would like to use the two uart in interrupt mode.
With only one, it works very well ( I juste have to add "set_bit(intcon, PEIE);" at the top of my program ).

I made some modification on the FCD file to add the second interrupt but if I use the two of them in my program, neither works :(

I attached my FCD file if somebody can have a look.

Thank you for your help !
Attachments
18F6527.fcd
(12.37 KiB) Downloaded 293 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: Interrupt on 2 UART

Post by Benj »

Hello

Your modified FCD looks ok to me. Something you could try is to manually perform a character read from both UART components before enabling the interrupt. This should clear any potential errors on the bus and hopefully allow the interrupts to start working.

Let me know how you get on.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Interrupt on 2 UART

Post by Mathy »

Hi Benj,

I already performed a character read from both UART without any sucess.

If I delete those character read and if I add this code at the top of the program.....it works !

Code: Select all

st_bit(intcon, PEIE);
st_bit(rcsta, SPEN);
st_bit(rcsta, CREN);
st_bit(rcsta2, SPEN);
st_bit(rcsta2, CREN);
8)

Post Reply