2021-02-01 02:25 AM
Hi,
I would like to send a data from my STM32F401CC to Arduino.
I have connected Tx to Rx and successfully upload the code to stm32 and Arduino Uno.
I don't get the values right, only first four readings, then all the values become random.
This is my stm32 code:
and this is the results:
the Arduino Uno code:
I configured both clocks to be the same 16Mhz.
Please, Any IDEAs?
2021-02-01 02:40 AM
Issue at Arduino end?
Try looking at STM32 output with scope or USB to CMOS Serial dongle.
Try increasing delay from 1ms to 250 or 1000.
Software Serial?
2021-02-01 02:55 AM
Yes.
If I connect the UART to usb serial port through (FTDI converter) I would get a perfect results in the serial monitor.
Which means, If I connect the stm32 directly to the serial port it is working, but If I send a data to the Arduino then display it from the Arduino end using its serial port, it doesn't work.
( I just want to implement the UART to UART protocol)
tried to increase the delay, same problem.
2021-02-01 05:54 AM
Hello malre.1,
hello everyone,
in the Arduino code,
in the callback function : "Serial Event ()" why did you put a "potentially infinite loop" ?
if "SerialEvent () is really a callback function, in my opinion you should process 1, 5 or ten bytes, and then let the function exit.
Instead, doing your way, the SerialEvent() could potentially never return if the serial port is flooded with bytes.
(But... I do don know anything about the Arduino platform :).
Please, try to process at most 4 bytes, or at most 10 bytes, and let us know...