Logging AVR data on PC

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an STK500, an Arduino Duemilanove Mega328, a BBUSB USB/RS232 adapter, a couple of PL-2303 USB/RS232 adapters.

What I want to do is take readings with an AVR analog port, this I am already doing, have a program on the PC read and log the changes and time-of-change to a file. Most of this I have already done or can do. The part that is missing is reading the data from the USART port on the AVR.

In the days when PCs had RS232 ports this was easy. Reading things in through a USB port, using Ubuntu Linux, that I'm having trouble figuring out. I realize this is a Linux/USB problem but I feel several people on here know how to do this using the BBUSB or PL-23032 adapters mentioned above and an AVR USART port. How is this done?

I'm willing to do this using Windows but much prefer Linux.

Thanks,
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just use Minicom and your USB-RS232 cable will likely be something like /dev/ttyUSB0 (dmesg should tell you what device name udev assigned to it).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't need any of your RS232 adapters. The Duemilanove already has a /dev/ttyUSB# device.

You either use a comms terminal program or simply open and read/write to the /dev/ttyUSB0 (or whatever #).

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I now have Minicom installed, set the com parameters to
19200 8N1
/dev/ttyUSB0 This matches what dmesg returns

The device Tx & Rx pins connected for loopback
But Minicom status is still Offline. How do I get it to go Online? What have I missed?

Thanks,
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

But Minicom status is still Offline.

That's talking about modems and DCD. Make sure it's configured to ignore hardware flow control, AVRs don't do that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you have your Arduino sending, in an endless loop, the same character? and receive it on your PC?
(http://www.joakimlinde.se/microc... sends always hello world! once both PC and Arduino have the same baudrate)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It doesn't matter that the status line says Offline, since you connect directly to the avr. It's when you dial another computer over a pair of modems the status can change to Online (is was more than ten years since I saw Online in minicom).

You may want to clear the "Init string", "Reset string" and "Hangup string" in cOnfigure Minicom / Modem and dialing, to prevent it from sending garbage on startup/close.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With the Tx and Rx pins connected I have the following setup
Comm Parameters: 19200 8N1
Terminal: default
Configuration Minicom:
Serial Port setup:
Serial Device: /dev/ttyUSB0
Hardware Flow Ctrl: no
Software Flow Ctrl: no
Screen and Keybd:
Add linefeed: yes
Modem and dialing:
Init String: (blank)
Modem has DCD line: no

I did clear the "Init string", "Reset string" and "Hangup string" in cOnfigure Minicom / Modem and dialing, to prevent it from sending garbage on startup/close

It is amazing how simple this setup really is. I was thinking, and trying to make it, harder than it really is. Gee, getting old is NOT for wimps!

Somewhere seems to me like I saw a reference to the old DOS comm program Telix. Yes, once I actually purchased a copy for my own use.

This works, thanks,
Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know what I have done wrong but not, actually an hour or so after my last post yesterday, Minicom started displaying loopback characters that looked like the baud rate was wrong. Unplugging the Arduino the character continued to be displayed wrong even without a loopback.

How can I check to see if /dev/ttyUSB0 is configured to loopback itself?

Tried Cutecom. It loops back all the time, the characters are what I type but the loopback takes place even with no /dev/ttyUSB0 device connected.

The presents of any device is being checked by the commands dmesg and dmesg | grep tty.

Mike