This project shows how to send the string "Hello world!\r\n" through the Universal Synchronous and Asynchronous Receiver and Transmitter (USART) peripheral every 500ms.
More details and code examples on the ATMEGA4809 can be found at the following links:
- TB3216 - Getting Started with Universal Synchronous and Asynchronous Receiver and Transmitter (USART)
- ATMEGA4809 Product Page
- ATMEGA4809 Code Examples on GitHub
- ATMEGA4809 Project Examples in START
- Microchip Studio 7.0.2397 or newer (microchip.com/mplab/microchip-studio)
- ATmega_DFP 1.5.362 or newer Device Pack
- ATMEGA4809 Xplained Pro (ATMEGA4809-XPRO)
The ATMEGA4809 Xplained Pro Development Board is used as test platform.
Initialize the USART1 instance with the following configurations:
- 9600 baud rate
- 8 data bits
- no parity bit
- 1 stop bit
- TX pin enabled (PC0)
Pin | Configuration |
---|---|
PC0 | Digital output |
-
Connect the board to the PC.
-
Open the atmega4809-getting-started-with-usart-studio.atsln solution in Microchip Studio.
-
Set the Send_Hello_World project as Start Up project. Right click on the project in the Solution Explorer tab and click Set as StartUp Project.
- Build the Send_Hello_World project: right click on the atmega4809-getting-started-with-usart-studio solution and select Build Solution.
- Select the ATMEGA4809 Xplained Pro in the Connected Hardware Tool section of the project settings:
- Right click on the project and click Properties;
- Click on the Tool tab.
- Select the ATMEGA4809 Xplained Pro (click on the SN) in the Selected debugger/programmer section, and save (CTRL + S):
- Program the project to the board: click on the Debug tab and click Start Without Debugging.
In this demo, the 'Hello World!' message is sent via serial communication every 500ms and is visualized using the Data Visualizer tool within Microchip Studio IDE.
This project shows how to send a string via serial communication using the USART peripheral.