Troubles with RS232 UART

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
flowcode-developer
Posts: 37
http://meble-kuchenne.info.pl
Joined: Thu Feb 02, 2023 9:32 pm
Has thanked: 19 times
Been thanked: 3 times

Flowcode v10 Troubles with RS232 UART

Post by flowcode-developer »

Hi,
I am using the Arduino chipset. I have provided my code as an attachment. I am attempting to send "HELLO\n" over UART from the ATMEGA2560 H0,H1,GND (channel 3)pins to docklight. I am connecting to the desktop with a rs232 to usb(PL-2303), null modem, and DB9 breakout connector. I also tried connecting with a RS232 Shield. I have tried with different baud rates and no luck. I use 1 start, 1 stop, no parity. Any suggestions?

I attached a pic of what I get if I try sending "HELLO\n" to docklight.


Something odd I noticed if I program the ARDUINO2560 using Arduino studio with the flowcode c-code i might get it to work. If build the .hex file and program with atmel-ice using microchip studio it will not work. Why?


I am banging my head on the keyboard because it seems like it is something so simple and I have not been able to get it.
Attachments
rs232_pic.PNG
rs232_pic.PNG (63.44 KiB) Viewed 1947 times
RS232_Example1.fcfx
(10.18 KiB) Downloaded 122 times

medelec35
Matrix Staff
Posts: 1913
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 621 times
Been thanked: 644 times

Flowcode v10 Re: Troubles with RS232 UART

Post by medelec35 »

Hello.
I edited your post to add the 10 post icon and I have just tested your project on the Arduino Uno.
UART is working as expected.
When UART does not work it's usually down to either the hardware clock speed does not match Flowcodes Clock speed setting, the baud is rate too high for the hardware, or wires too long from TX output to the UART to USB converter etc.
If I was you I would run a one-sec flasher test to make sure your hardware is running at the correct speed.
If you have a scope or a logic analyser Just send an upper-case U and measure either one bit mark or space duration, then baud rate = 1/mark or space duration.
Martin

flowcode-developer
Posts: 37
Joined: Thu Feb 02, 2023 9:32 pm
Has thanked: 19 times
Been thanked: 3 times

Re: Troubles with RS232 UART

Post by flowcode-developer »

I switched to the AVR chipset. Do you have any material for me to reference on how to set the oscillator? This is the board i am using https://www.bipom.com/products/us/851677.html. It has a CS10-14.7456MABJTR crystal installed on the board. Here are more documents for this board https://www.bipom.com/web_documents/851677.html. Thank you

medelec35
Matrix Staff
Posts: 1913
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 621 times
Been thanked: 644 times

Re: Troubles with RS232 UART

Post by medelec35 »

I have noticed you have set the clock within project options for 8MHz and you have stated the crystal is 14.756 MHz
So you could change the clock to 14.756, then try again.
If still not working then you can try the suggested tests.
Martin

flowcode-developer
Posts: 37
Joined: Thu Feb 02, 2023 9:32 pm
Has thanked: 19 times
Been thanked: 3 times

Re: Troubles with RS232 UART

Post by flowcode-developer »

That worked. I used the following settings.
oscillator_settings.png
oscillator_settings.png (78.03 KiB) Viewed 1881 times
Thank you

Post Reply