Pages: [1]   Go Down
Author Topic: Debug Output From (Can't use Serial.print)  (Read 1379 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am interfacing my Arduino based device with a closed sourced Windows program.  The Windows program will communicate with the Arduino over USB.

As I get up to speed with the Arduino app parsing and processing data it receives, it would help if I can display debug statements generated by the Arduino program.  I can't use the serial console in the IDE as the program I am interfacing with has exclusive access to the USB port.

What methods are easily available to have the Arduino program output available?  It does not need to be real time.  I have an Arduino Mega.

Thanks,

John
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have used software from the project linked to below during similar development projects and it works great.

http://com0com.sourceforge.net/
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well the fact that you have a Mega board that has 4 hardware serial ports, an easy method would be to purchace a USB serial module and wire it to one of the Mega's additional serial ports. You can then use a PC serial terminal program (hyper terminal, etc) to monitor your debug commands that you imbed into your sketch.

Here is one example:

http://www.sparkfun.com/commerce/product_info.php?products_id=9115

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks...between those options I can work through it.
Logged

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You could always use a MAX232 or compatible, and you don't even need to take up your hardware serial, you can just use NewSoftSerial and use Serial.print that way.

I made an arduino board based off the max232 (much easier to solder smiley-grin) and I used the extra set of pins on the max232 for a NewSoftSerial RS232 version. So I can talk to RS232 devices via any pin! smiley-grin
Logged

Calgary, AB, Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 196
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheat!

Use a serial lcd and connect it in parallel with the Pins.

It will then display anything sent to that port.  Just make sure your debug statements include a \n to jump down to the next line on the LCD.
« Last Edit: November 15, 2009, 09:36:54 pm by brutus1975 » Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Use a serial lcd and connect it in parallel with the Pins.
If data sent to the PC application is binary, you will not be able to display/view the data on the LCD. The binary data may even reconfigure your display (switch it off, change baudrate, enable blinking, change backlight etc.).  Even with ASCII only (e.g. GPS data) it is not practical because the volume of data is likely to overflow the LCD display quickly.
Quote
Just make sure your debug statements include a \n to jump down to the next line on the LCD.
Anything you add to the serial stream will also reach the PC application and may upset whatever protocol you're implementing.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Anything you add to the serial stream will also reach the PC application and may upset whatever protocol you're implementing.

Correct, for debug statements to make sense for troubleshooting a application talking to a PC, then it needs to stream to a different serial port, hardware or software.

Lefty

« Last Edit: November 16, 2009, 02:13:28 am by retrolefty » Logged

Pages: [1]   Go Up
Jump to: