How to display USART TX char data in MPLAB X IDE?

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

I am trying to visualize ASCII chars '0' to '9' I am sending to USART in a loop but I don't know how to visualize them as ASCII chars in Data Visualizer. What should I do? Simple Serial Port Terminal (MPLAB plugin) doesn't' work.

 

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

Putty will do.

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

Using the debugger to view the contents of the USART data buffer won't work for transmit because receive and transmit use the same name (but  different hardware registers). If you are using a chip that is double-buffered, those extra registers are invisible. 

 

For me, the easiest way is to use real hardware with a real terminal.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Kevil wrote:
Simple Serial Port Terminal (MPLAB plugin) doesn't' work.

 

Well, I think you might also take a look at this point: You are obviously using an Atmel START generated project with MPLAB-X. I would suppose that the START is basically developed to work with AS7 and not MPLAB-X. for MPLAB has another code generator. Also in your software you need to add the needed headers

 

"uint8_t" is not recognized as i can see, why ? because you need to include the standard library <stdint.h>.

 

 

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

Moe123 wrote:

"uint8_t" is not recognized as i can see, why ? because you need to include the standard library <stdint.h>.

This is not an error but a bug in MPLAB. The code compiles without any problem, The Microchip is working on fix it see their reply:

 

"We are aware of issues with the syntax highlighting and are working on fixing it."

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

Moe123 wrote:
library <stdint.h>.

Note that it's just a header file - not a library.

 

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: 1

awneil wrote:

Moe123 wrote:

library <stdint.h>.

 

Note that it's just a header file - not a library.

 

 

Sorry, you are right. didnt chose the right words.

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

The orange graph shows the char values sent out of USART TxD e.g. ASCII value of '5' is 53 in decimal. I just need to display the decimal values in ASCII chars.

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

Kevil wrote:
I just need to display the decimal values in ASCII chars.
Then get any standard terminal program for your operating system. If Windows it could be Teraterm, Realterm, Brays (or whatever it is called these days), etc etc. In Linux use putty or minicom or similar.

 

(personally I use teraterm in Windows).

 

While I suppose it might be nice to have a terminal "inside" MPLAB the fact is that there's no reason it has to be built in. Using a separate program will give you far more choice of programs with much wider feature sets.

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

clawson wrote:
personally I use teraterm in Windows

Likewise.

 

A particularly useful feature of Teraterm, I find, is that it can timestamp its log files - so you have a record of not only what happened, but also when it happened.

 

Using a separate program will give you far more choice of programs with much wider feature sets.

+1

 

EDIT

 

Another advantage of having the terminal separate from the IDE is that you then don't have to fire up the IDE just to use the terminal.

 

And, when you have to switch to using a different IDE, you can just keep using the same terminal - no need to relearn the new IDE's terminal.

 

Plus it can be more convenient to have the terminal separate - that can, eg, make it easier to have the terminal on a separate screen ...

 

etc, etc, ...

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...
Last Edited: Tue. Oct 1, 2019 - 10:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

(personally I use teraterm in Windows).

 

Many thanks for your advice. Teraterm is running well.