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.
regards
ARM
Bug in ARM serial communication and external Interrupt
Moderator: Benj
- 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
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.
If not then let me know.
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.
If not then let me know.
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
- 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
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.
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.
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
Re: Bug in ARM serial communication and external Interrupt
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
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
- 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
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.
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.
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