STM32F407 UART/USART

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

STM32F407 UART/USART

Post by Alan_37 »

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.
uart.png
uart.png (26.32 KiB) Viewed 4409 times
A bit of help will be greatly appreciated :)

I am also attaching the flowcode file below
Attachments
Flowcode1.fcfx
(43.15 KiB) Downloaded 148 times

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times
Contact:

Re: STM32F407 UART/USART

Post by Alkaline »

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.
Attachments
UART_TEST.fcfx
(25.49 KiB) Downloaded 176 times

User avatar
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

Post by Alan_37 »

Hi Alkaline

Thanks for your reply I will test this and let you know the outcome shortly

Alan

User avatar
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

Post by Alan_37 »

Hi Alkaline

It Works 100% thanks very much for your help.

Alan

Post Reply