Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Terminal emulator for CDC
02-05-2014, 05:19 PM, (This post was last modified: 02-05-2014, 05:23 PM by linus81.)
#1
Terminal emulator for CDC
Hi everyone, I was wondering .... why an terminal emulator for the CDC was not included in the IDE? It would be convenient not to use external emulators. Thanks.

Giuseppe.
Reply
04-05-2014, 01:17 AM,
#2
RE: Terminal emulator for CDC
Why reinvent the wheel? There are many dedicated terminal emulators for Windows, OS X and Linux already.
Reply
04-05-2014, 07:50 PM, (This post was last modified: 04-05-2014, 08:10 PM by djpark.)
#3
RE: Terminal emulator for CDC
(02-05-2014, 05:19 PM)linus81 Wrote: Hi everyone, I was wondering .... why an terminal emulator for the CDC was not included in the IDE? It would be convenient not to use external emulators. Thanks.

USB CDC provides virtual COM port and any existing terminal emulation program should be able to open the port. So as Pinguino said, there is no need to reinvent the wheel. I use both SCRT and PuTTY on Windows and minicom on Linux.

I believe the Pinguino IDE designer had the idea of including a terminal emulator to be used as a debug port, but not implemented. Following other compiler philosophy, writing to stdout and reading from stdin are expected to be redirected to UART but I don't know if it works for Pinguino. In fact I find it easier in programming to explicitly selecting the in/out device.

Using USB CDC as debug terminal has a few disadvantage. The host PC and the Pinguino need to establish the device configuration before opening the port. The port number will be different for different PCs. Once the connection is broken, you need to close the current connection before opening a new connection. If the previous connection was closed after Pinguino is reset, Pinguino needs to detach and attach CDC or reset again.

These problems will give you at least 2 practical problems.

1) You can't open the port and wait for Pinguino to start, you have to open the port after Pinguino start. If you don't want to miss the initial debug message you may be sending, you need to add a delay or blocking statement in the application. Alternatively, you can write a program to look for the CDC port available and call a terminal emulator upon detection.

2) If you are having problem of Pinguino reset due to whatever problem such as watchdog, the terminal will not work until you close and restart.

Considering the above, using UART as debug port is more appropriate. Just set the terminal emulator ready and start or restart Pinguino any time. If TTL to RS232 signal conversion is an issue, you can search this forum as well as Google to get simple converter using a transistor or FET.

DJ

I may sound a little paradoxical, but I find it more convenient not to use Pinguino IDE and built-in debugger even if it is provided in future simply because the editor quality has a long way to catch up with many editors available besides I am more used to call make from command line script.

This gives me more flexible automated compiling, loading and debugging cycle. In my script, the attached cdcterm.exe (remove .txt from the name) is called after the mphidflash.exe successfully uploading the hex file. It will search for the vendor id and product id to look for Pinguino CDC to be available. Once it is detected, it execute PuTTY.

With about 2 seconds delay in Pinguino startup (setup()) allows to capture every CDC output.

DJ


Attached Files
.txt   cdcterm.exe.txt (Size: 129.5 KB / Downloads: 23)
Reply
06-05-2014, 04:20 PM,
#4
RE: Terminal emulator for CDC
The goal, in fact, is not reinvent the wheel, but to eliminate the disadvantages listed exactly by DJ. The need to synchronize the communication is ugly. My question concerned a requirement of usability (especially for newbies) ... The advantage of a PIC with integrated USB port does not have to be a disadvantage of using a TTL-RS232 converter for debugging Smile ... Thank you for your answers.

Giuseppe.
Reply
10-10-2015, 07:38 AM,
#5
RE: Terminal emulator for CDC
The arduino serial monitor did hang to I thinks it's fixed. But you can't catch the start of a send anyway you go the pinguino has to be plugin then open terminal program. Maybe the bootloader hid type could overcome the CDC shortcomings.
Reply
19-01-2016, 08:46 PM,
#6
RE: Terminal emulator for CDC
Hi
if u use Linux u can use minicom
sudo minicom -o -D /dev/ttyACM0

or
CuteCom
Reply
01-08-2016, 03:15 PM,
#7
RE: Terminal emulator for CDC
I agree, we need to put terminal back in Pinguino.

In which language is this coded? I can try adding it back, but I need the code of old working terminal for reference.

We need to compete with Arduino IDE.
Reply
02-08-2016, 03:54 AM,
#8
RE: Terminal emulator for CDC
having a built in serial terminal would be useful.

a hex mode would also be useful.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)