sending results to the pc

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

I'm using the Atmel ICE/JTAG interface to program ATMEGA2560's to control outside devices.  The devices are remote from my pc  so I can't see the results when debugging.  I can see the binomial output in the watch window but that's not very user friendly.  I'd like to send these binomial values in the watch window so I can show the results on a graphic display.  I can see several strategies to do this, but would like to hear from anyone who has a successful method for establishing this data transfer.  I guess I could just copy the data from the watch window and paste it into the graphic program - crude but it would work.

Last Edited: Wed. Jan 1, 2020 - 11:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A common technique is to format the data as comma delimited lines and send via the serial port. You can then use various programs to receive the data and massage it as you see fit. Python is popular for this kind of work.

 

 

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

As Kartman says, a common way (the commonest way?) would be to use the microcontroller's UART to send the data to a COM port on the PC.

 

Nowadays, that would most likely mean using a USB-to-UART adaptor to give a virtual COM port on the PC.

 

This is entirely general for any microcontroller - not specific to AVR.

 

An advantage of using text formatted data is that it's human readable - which makes debugging easier, and it can simply be captured in a standard terminal program with  no special PC code required.

 

If you've never done this kind of thing before, this is probably the way to start - it's easier to "see" what's happening!

 

Downside is that it requires some extra processing on the microcontroller (for the conversion into text format), and is a lot less efficient in terms of the bandwidth used.

 

The alternative is to use a binary protocol.

 

There's a whole load of protocol suggestions here:  https://www.avrfreaks.net/forum/protocol-streaming-serial-data

 

Kartman wrote:
Python is popular for this kind of work.

Indeed: both for the serial data handling -  https://pythonhosted.org/pyserial/ - and then for processing & presenting the data.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CSV data can also be read and displayed in graphic form by any spreadsheet!

 Jim

 

 

 

 

 

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

hackettet@gmail.com wrote:
The devices are remote from my pc  so I can't see the results when debugging.
Atmel Studio?

atbackend.exe has IP ports :

https://www.avrfreaks.net/forum/faster-programming-tools-using-snap#comment-2821586

hackettet@gmail.com wrote:
I'd like to send these binomial values in the watch window so I can show the results on a graphic display.
Atmel Studio's Data Visualizer extension has Graph | Data Visualizer User's Guide

 

"Dare to be naïve." - Buckminster Fuller

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

gchapman wrote:
Atmel Studio?

I am a bit confused as to whether this is just for debug, or as a part of the final system - perhaps  hackettet@gmail.com could clarify ... ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...