Bug in ARM serial communication and external Interrupt

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
ARM
Posts: 29
Joined: Sun Oct 04, 2015 11:52 am
Been thanked: 3 times
Contact:

Bug in ARM serial communication and external Interrupt

Post by ARM »

Hello,

I am using the ARM controller AT91SAM7S512_64.

On PA31 i use a switch for jumping in a macro to send commands over RS232 to the display. Transmitting data to the display and receiving "ACK" from the display is OK (0x06). (Macro: Open_TouchMacro)


Pin 20 of the controller (IRQ0) is connected to the "SBUF" pin of the display. This pin does signalisate, that a touch button is pressed.

Sending a command over RS232 in the external interrupt 0 is ok. This command is used for that display must now send the specific code of the pressed touch button.
But when I´m writing the value of the received "ACK" in a variable, the value is always 0xFF.

Now when I´m jumping again with the switch on PA31 in the macro "OpenTouchMacro", sending commands to the display is ok, but the received "ACK" byte is always now 0xFF. When i do reset the controller, receiving is ok again, so long if I did not jump in external interrupt 0

I think there is a problem when I am receiving serial data in external interrupt.
Flowcode HMI-Control 3.fcfx
(25.84 KiB) Downloaded 307 times

regards

ARM

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: Bug in ARM serial communication and external Interrupt

Post by Benj »

Hello ARM,

Here is an example of using the RX_INT interrupt to reliably collect incoming UART data and store it for processing later. Can you have a go with this and see how you get on, it's working as expected for me.

If this is ok then simply move the code to read from the circular buffer into your external interrupt macro and hopefully everything should work as expected.
ARM_RXINT.fcfx
(8.52 KiB) Downloaded 306 times
If not then let me know.

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: Bug in ARM serial communication and external Interrupt

Post by Benj »

Hello,

I thought I would also test this for you just to be sure, again it's working as expected but my chip is slightly different to yours so could potentially be a bug in the chip specifics.
ARM_RXINT_ExtINT.fcfx
(9.42 KiB) Downloaded 306 times

ARM
Posts: 29
Joined: Sun Oct 04, 2015 11:52 am
Been thanked: 3 times
Contact:

Re: Bug in ARM serial communication and external Interrupt

Post by ARM »

Hello Benj,

many thanks for the example. I will test it the next days. I hope not that the bug was in the controller. I must use SAM7S512 because I need much ROM for HMI applications. If the program didn´t run, then I must wait for Flowcode 7.

PS: Flowcode is very interesting and I think in the future a real alternative for Labview. I wish you much sucess.

greetings ARM

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: Bug in ARM serial communication and external Interrupt

Post by Benj »

Hello ARM,

Many thanks, let me know how you get on and if you do have any problems then please let me know and I will do my best to jump on it for you.

Post Reply