Skip to content

A quick port of Ted Burke's awesome ComPrinter utility (for doing simple serial operations at the command line) to allow it to be compiled in Visual Studio C++

Notifications You must be signed in to change notification settings

wmrichman/ComPrinterW64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ComPrinterW64

A quick port of Ted Burke's very useful ComPrinter to Visual Studio C++.

ComPrinter is a console application (i.e. a command line program) that opens a serial port and displays incoming text characters in the console. It features several very useful options, including the following:

ComPrinter supports a user-specified COM port number. ComPrinter supports a user-specified baud rate. By default, ComPrinter opens the highest available COM port (especially useful if you’re using a USB-to-serial converter). ComPrinter provides a facility to simulate a keystroke for each incoming character. In combination with a USB-to-serial converter, this provides a very simple way of turning a microcontroller system with serial output into a communication device. It provides an ideal free alternative to HyperTerminal in many applications.

Support ComPrinter Development ComPrinter is completely free to download and use.

Ted requests, "You can support ComPrinter development by letting me know if you find it useful." You can do so on his web page at https://batchloaf.wordpress.com/comprinter/

This version includes the additions he describes in the discussion on his page.
Again, this was all Ted's work.

I’ve added four new options for causing ComPrinter to exit.

  • 1. Exit after a certain number of characters.
  • For example, to exit after 5 characters: ComPrinter /charcount 5
  • 2. Exit after a timeout – i.e. no data received for the specified number of milliseconds.
  • For example, to exit after 2 seconds of no data: ComPrinter /timeout 2000
  • 3. Exit when a certain character is received.
  • For example, to exit when the letter ‘x’ is received: ComPrinter /endchar x
  • 4. Exit when a certain hex byte is received.
  • For example, to exit when the hex value 0xFF is received: ComPrinter /endhex FF
-----------------------------------------------------------------------------------------------------------------

Thanks again for the awesome utility, Ted! I use it in a batch file to automate programming a processor via the automation commands available with the STM utility STM32_Programmer_CLI.exe included with the STM32CubeProgrammer. The batch file is run on the PC, and using ComPrinter, it waits until the attached Arduino that runs the rest of the test fixture sends it a Ctrl-z, then runs the programming utility and loops around waiting for another one:

:top
REM Wait for Ctrl-Z from Arduino on Com4 before proceeding (and don't stuff received characters into the keyboard buffer!)
comprinterw64-Arduino /devnum 4 /baudrate 19200 /endhex 1A /quiet /keypress
"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=swd -e all -d

if ERRORLEVEL 0 goto top
echo "Something went wrong!!!"
pause
goto top

About

A quick port of Ted Burke's awesome ComPrinter utility (for doing simple serial operations at the command line) to allow it to be compiled in Visual Studio C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages