RXINT

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
User avatar
jollybv
Flowcode v5 User
Posts: 376
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times

RXINT

Post by jollybv »

Hi Guys

I have never used interrupts before and I'm trying to understand them, I have written a small program just to see how this works but i cant get the RXINT interrupt to work when i send data via RS232 can anyone look at the attached program and tell me where I'm going wrong???

Brian
RXIN.fcf
(9.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: RXINT

Post by Benj »

Hello Brian,

Your program looks ok but your configuration does not. Please ensure that both your configuration and clock speed are correct. You can do this by creating an endless loop that outputs a 1 to a LED, waits a second then outputs a 0 and then waits another second. When the delays on the hardware equal 1 second then you have everything correct and your baud rate for the UART should then work correctly to receive data.

User avatar
jollybv
Flowcode v5 User
Posts: 376
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times

Re: RXINT

Post by jollybv »

Hi Ben

Not quite sure what you mean, I understand I had my clock speed set to RX not HS and the RS232 properties the Baud rate = 9600, the Tx/Rx = UART1, data bits = 8, Char Receive = Byte (legacy) Rx time out = LegacyI understand putting the led in an endless loop 1s on, 1s off but how will I know "When the delays on the hardware equal 1 second" where will i find this to get my baud rate for the UART

Brian

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: RXINT

Post by Benj »

Hello,

If your flashing a LED then you can time in your head to see if the LED is roughly on for a second. It should be fairly obvious when the timings are working correctly.

1) Ensure that the clock speed in project options matches your crystal speed.

2) Ensure that the configuration settings are correct eg HS oscillator, watchdog disabled etc...

All the configuration settings are described in the device datasheet.

Once you have the hardware running correctly then RS232 should just work.

User avatar
jollybv
Flowcode v5 User
Posts: 376
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times

Re: RXINT

Post by jollybv »

Hi ben
Sorry you might have go me wrong..?? I have "NO hardware" for this device all I'm trying to do is check how the interrupt works in the simulation. I have put a toge point in the RXINT macros to see if the interrupt is executed when I type in the "Char in Queue" but this dose not seem to work and see the interrupt.

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: RXINT

Post by Benj »

Ah I see,

Ok that explains things. I don't think that the RXINT works in simulation, should work correctly on hardware, sorry for any inconvenience.

Post Reply