Step 2: Configure SERCOM3, SysTick and DMA

Last modified by Microchip on 2026/06/29 11:04

Configure SERCOM3 as Universal Synchronous Asynchronous Receiver Transmitter (USART) Peripheral

Note: Create an MPLAB® Harmony v3 project using MPLAB X IDE (refer to Lab 1, Step 2 for detailed project creation instructions). After the project is created, follow these steps to configure the Serial Communication 3 (SERCOM3) peripheral for USART operation, set up the TX and RX pins for serial communication, and configure Direct Memory Access (DMA) for a DMA‑driven project.

After launching MPLAB Code Configurator (MCC), navigate to the Device Resource tab. In the Device Resource panel, expand Libraries > Harmony > Peripherals > SERCOM3. To add the SERCOM3 Peripheral Library (PLIB) to the project graph, either double-click on SERCOM3 or drag and drop it into the project graph area.

SERCOM3 in Project Graph                    

Right-click the Yellow UART diamond icon in SERCOM3 and select STDIO from the Available Consumers. This setup enables functions such as printf() to transmit data to the terminal.

SERCOM3 UART setup

Select the SERCOM3 peripheral library in the Project Graph. The configuration options will be displayed on the right side of the interface. By default, the SERCOM operation mode is set to USART communication. Configure SERCOM PAD [1] as the Receive Pinout.

SERCOM3 Configuration Options


Pin Configuration for SERCOM 3

Open the Pin Configuration tabs by clicking Project Graph > Plugins > Pin Configuration.

Project Graph Plugins drop-down

Select the Pin Settings tab in MCC and sort the entries by Ports, as shown in the accompanying image.

Pin Setting tab

Scroll down to pin number 7 (Pin ID: PB08) and pin number 8 (Pin ID: PB09). Configure PB08 as SERCOM3_PAD0 and PB09 as SERCOM3_PAD1. Set the Security Mode to NON-SECURE.

Pin Setting tab


Configure SysTick Timer

After launching MCC, select System in the Project Graph. The configuration options will appear on the right side of the interface. Expand Cortex-M23 Configuration > SysTick, then select Enable SysTick. Navigate to SysTick Configuration and select Enable Interrupt.

Configuration Options


Arm® TrustZone® for Armv8-M

Go to Project Graph > Plugins and select the Arm TrustZone for Armv8-M option from the drop-down.

Project Graph Plugins drop-down

In the Peripheral Configuration > Peripherals section of the Arm TrustZone for Armv8-M window, configure the required peripherals to operate in Non-Secure mode. Set SERCOM3 to the non-secure configuration.

Arm TrustZone for Armv8-M window

Note:

  • For the project without DMA (CPU-driven transfer), go to Generate Code and follow the corresponding steps.
  • For the project with DMA (DMA-driven transfer), proceed to Configure DMA and follow the outlined steps.

Configure DMA

Open the DMA Configuration tab by clicking Plugins > DMA Configuration.

Project Graph Plugins drop-down                       

In the DMA Configuration window, select DMAC Channel 0 from the Active Channels List and set the trigger source to Software Trigger. Ensure that the DMA Channel 0 Settings match those shown in the accompanying image.

DMA Configuration window


In the Arm TrustZone for Armv8-M window, set the DMAC to non-secure.

Arm TrustZone for Armv8-M window

Back to Top