Skip to content

This example shows how to send a string to the PC and see it in the MPLAB Data Visualizer Terminal.

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/pic18f47q10-cnano-eusart-hello-world-mcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCHP

Sending "Hello World" Message via EUSART using the PIC18F47Q10 Microcontroller with MCC Melody

This example shows how to send a string of messages through the EUSART peripheral from the PIC18F47Q10 microcontroller (MCU) to the PC and use MPLAB® Data Visualizer to see it.

Related Documentation

Software Used

Hardware Used

  • PIC18F47Q10 Curiosity Nano Development Board is used as a test platform. (DM182029)

Operation

To program the Curiosity Nano board with this MPLAB® X project, follow the steps provided in the How to Program the Curiosity Nano Board chapter.

1. Setup

The following peripheral and clock configurations are set up using MCC Melody for the PIC18F47Q10:

  • Clock Control:

    • Clock Source: HFINTOSC
    • HF Internal Clock: 4 MHz
    • Clock Divider: 4
  • Configuration Bits:

    • CONFIG3L
      • WDT Operating Mode: WDT Disabled
  • EUSART2 Peripheral:

    • Transmit Enable: Enabled
    • Serial Port Enable: Enabled
  • UART2:

    • Requested Baudrate: 9600
    • UART PLIB Selector: EUSART2
  • Pin Grid View:

    • EUSART2 TX2: RD0 pin (CDC pin)

The following pin configuration must be made for this project:

Pin Configuration Function
RD0 Digital Output EUSART2 TX

2. Demo

In this demo, the message Hello World! is sent via serial communication every 1000 ms. MPLAB X Data Visualizer is used as a terminal to see the output message.


3. Summary

In this example, EUSART most common configuration is used (asynchronous operation and 8N1 message format), and "Hello World" messages are transmitted. MPLAB X Data Visualizer is used to see the messages on the PC.

How to Program the Curiosity Nano board

This chapter shows how to use the MPLAB® X IDE to program an PIC® device with an Example_Project.X. This can be applied for any other projects.

  • Connect the board to the PC.

  • Open the Example_Project.X project in MPLAB X IDE.

  • Set the Example_Project.X project as main project.

    • Right click on the project in the Projects tab and click Set as Main Project.
  • Clean and build the Example_Project.X project.

    • Right click on the Example_Project.X project and select Clean and Build.
  • Select the PICxxxxx Curiosity Nano in the Connected Hardware Tool section of the project settings:

    • Right click on the project and click Properties
    • Click on the arrow under the Connected Hardware Tool
    • Select the PICxxxxx Curiosity Nano (click on the SN), click Apply and then click OK:
  • Program the project to the board.

    • Right click on the project and click Make and Program Device.