Debugging the USB Serial port on Arduino

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

Moderator: Benj

Post Reply
User avatar
CamargoF
Posts: 36
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 7 times
Contact:

Debugging the USB Serial port on Arduino

Post by CamargoF »

I configured the Arduino USB as serial and I would like to know how FC8 can help me to see all transmitted data.

I set the Simulation COM Port on USB_Serial panel, but it is not displaying anything on console when I ran the code in Arduino.
The console displayed all USB_Serial messages when running my code on FC8 simulation, but I need the check the real world now.

Any recommendation?

Best regards,

Fernando

User avatar
CamargoF
Posts: 36
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 7 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by CamargoF »

By the way.
  • I created the driver, using the USB Driver option on USB_Serial Panel, but Windows 10 did not accept it due to the lack of signature.
  • I installed the USB Driver I got from USB Serial Wiki. The installation was a success, but Windows refuses to use it. The device manager shows the USB-SERIAL CH340 (COM3) is running the wch.cn driver.
I installed the (old) Hyperterminal to see the messages from Arduino, nut nothing has been displayed.

Please, help me. This is the last issue to release the firmware.

User avatar
CamargoF
Posts: 36
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 7 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by CamargoF »

I replaced the USB_Serial by the UART component and I was able to receive the data from USB port. :?
I dislike the solution, but it works.
It looks like there is some problem on USB Serial component that does not transmit anything.

User avatar
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: Debugging the USB Serial port on Arduino

Post by Benj »

Hello,

Most Arduino devices have an USB to Serial IC on board and so the USB is converted to serial data which is connected to the UART on the AVR IC.

Using the USB Serial component will not work because it requires a true USB connection from the microcontroller rather than a UART connection.

Under the Tools component menu there is a Serial Monitor component you can use to see the data coming from your Arduino using the Flowcode console.

User avatar
CamargoF
Posts: 36
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 7 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by CamargoF »

Understood.
The USB on Arduino Uno R3 is not a true USB, so I have to use the UART, correct?
I will check the console. Best regards.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by medelec35 »

If you get stuck, then I have a test flowchart that sends and receives via USB/UART connection for UNO.
Works with simulation as well as hardware.
Martin

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by stefan.erni »

Hi Martin

Thanks for your suggestion. I would like to have your Flowchart. Would like to understand more of the simulation with USB/Uart ...

regards
Stefan

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by medelec35 »

Hi Stefan,
There are two ways of achieving what you want to do.
1 Ben's suggestion which is using the Serial monitor (See attached flowchart)
2 Using a serial terminal emulator like Tera Term and setting it for the port that Arduino is set to.
If using either method and they have the port open, then you must make sure port is closed before sending any programs to hardware.
With the first option, you must manually change the serial monitor Connection from Open to close.
Relying on the automatic stopped my Uno from being programmed.
When finished programming then change back to open.
Don't forget as the serial is monitoring the hardware, no need to run simulation.
Serial Mon.png
(43.61 KiB) Downloaded 2718 times
Attachments
Ardunio UART Test 1.fcfx
(9.75 KiB) Downloaded 311 times
Martin

User avatar
CamargoF
Posts: 36
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 7 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by CamargoF »

I was missing some tool to help me to see the USB serial port communication when I load the firmware into Arduino.

As I was not able to find any tool on Flowcode I installed Arduino to use its Serial Monitor tool, and it worked very well.
This tool allowed me to see the transmitted data as well as to sent commands to Arduino through the serial port. It is a handy tool.

zimmerMAN
Posts: 1
Joined: Wed Feb 13, 2019 2:42 pm
Contact:

Re: Debugging the USB Serial port on Arduino

Post by zimmerMAN »

The only one I have found for x64 is Serial port monitor which is really quite good. Not free, but how is the output good. There is a 14-day trial. Honestly, I've been hoping (for quite a while now) that Mark R. would release a 64-bit version of portmon.
Last edited by zimmerMAN on Thu Sep 05, 2019 2:14 pm, edited 1 time in total.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Debugging the USB Serial port on Arduino

Post by LeighM »

I use Putty, it does simple COM ports as well as SSH and telnet
http://www.putty.org

User avatar
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: Debugging the USB Serial port on Arduino

Post by Benj »

I use RealTerm, It's a sourceforge project and works well.

It even has a spy feature so you can snoop on a COM port but this requires payment and licensing.

Post Reply