Skip to content

This example shows how to use the printf function to send messages over EUSART and display charts in MPLAX Data Visualizer using Data Stream Protocol.

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/pic18f47q10-cnano-eusart-printf-bare

Repository files navigation

MCHP

PIC18F47Q10 EUSART Send Formatted Messages Using printf

It is a common use case for an application to send a message with variable fields over EUSART, when the application reports a sensor reading, for instance. Using formatted messages is a very flexible approach and reduces the number of code lines. This can be accomplished by redirecting STDIO to EUSART.

In this example, a counter value and twice its value are sent in a binary format, using the Data Stream Protocol, over EUSART. The MPLABX Data Visualizer has a built-in Data Stream Protocol decoder and can display charts of the values in the message in real time.

Related Documentation

Software Used

Hardware Used

Setup

The PIC18F47Q10 Curiosity Nano Development Board (DM182029) is used as the test platform. It has an onboard debugger that acts as an USART to USB convertor so no further hardware is needed.

The following configurations must be made for this project:

Pin Configuration
RD0 Digital Output

Operation

Run the code and configure the Data Visualizer as described in the Technical Brief document.

Demo in MPLABX Data Visualizer

Summary

This example shows how to enhance the "Hello World" use case with the ability to use printf function to send messages over EUSART. In this example, messages are Data Stream protocol frames, MPLAB Data Visualizer can be used to display them as plots.

About

This example shows how to use the printf function to send messages over EUSART and display charts in MPLAX Data Visualizer using Data Stream Protocol.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •