Hi
I just started playing with STM32 so this is new for me, now I just came across something strange
I made a simple flowcode that initialize the Uart, enables the UART1 RX Interapt, the interapt calls a
macro to receive a string then that string is sent back to me so that I can test the UART is working correctly
everything is working fine until it comes in the part to send the string back to me, below you can see I am sending
a string: Test and I receive back the first 2 characters in a strange way.
A bit of help will be greatly appreciated
I am also attaching the flowcode file below
STM32F407 UART/USART
Moderator: Benj
-
- Posts: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: STM32F407 UART/USART
Hello
I rewrote part of the program for you. If you use the interupts it is a good idea that the macro called by the inteurp does not introduce delay ect.
In this case the function receives a character from the uart port and puts it in a buffer. This allows to receive more characters, to store them in a buffer and subsequently to go and analyze them.
So the macro that performs the character reception has to do that and that's it and in the shortest time possible
In main, each data received is analyzed and put into a string.
I rewrote part of the program for you. If you use the interupts it is a good idea that the macro called by the inteurp does not introduce delay ect.
In this case the function receives a character from the uart port and puts it in a buffer. This allows to receive more characters, to store them in a buffer and subsequently to go and analyze them.
So the macro that performs the character reception has to do that and that's it and in the shortest time possible
In main, each data received is analyzed and put into a string.
- Attachments
-
- UART_TEST.fcfx
- (25.49 KiB) Downloaded 181 times
- Alan_37
- Posts: 179
- Joined: Sun May 01, 2016 8:36 pm
- Has thanked: 51 times
- Been thanked: 54 times
- Contact:
Re: STM32F407 UART/USART
Hi Alkaline
Thanks for your reply I will test this and let you know the outcome shortly
Alan
Thanks for your reply I will test this and let you know the outcome shortly
Alan