5.2.1 SAM D21 Curiosity Nano Evaluation Kit

Two SAM D21 Curiosity Nano Evaluation Kits are connected to each other by the SERCOM USART lines (TxD, RxD) and it is connected to the PC terminal through the EDBG port.

Note: Click here to access the source code for this application configuration. Alternatively, it is also available in the GitHub reference_apps repository.
Figure 5-7. Block Diagram (SAM D21 Curiosity Nano Evaluation Kit)

To add and configure MPLAB Harmony components using MCC, follow these steps:

  1. To create the project, refer to Creating the Project.
  2. In the MCC window, click Project Graph.
  3. Under Device Resources, click and expand the list of options Harmony > Peripherals > SERCOM.
    Figure 5-8. Device Resources
  4. Click SERCOM1 and SERCOM5.
  5. Observe that the SERCOM1 and SERCOM5 Peripheral Library blocks are added in the Project Graph window.
    Figure 5-9. SERCOM1 and SERCOM5 Added in the Project Graph Window
  6. From the Plugins drop-down list, select Pin Configuration and then click Pin Settings (see Figure 5-12).
    Figure 5-10. Select the Plugin
  7. From the Order drop-down list, select Ports to build configurations according to the application as shown below.
    Figure 5-11. Pin Settings
  8. Configure the following pins PA16, PA17, PA18, PA19, PA22, and PB22 as SERCOM1_PAD0, SERCOM1_PAD1, SERCOM1_PAD2, SERCOM1_PAD3, SERCOM5_PAD0, and SERCOM5_PAD2, respectively.
    Figure 5-12. Pin Configuration
  9. In the Project Graph window, in the left Navigation bar, select SERCOM5 Peripheral Library and in the right Configuration Options property page, configure it as showin below to print the data on the Serial Console at 9600 baud rate.
    Figure 5-13. Altering the PAD and Baud Rate in SERCOM5
  10. Select SERCOM1 Peripheral Library and in the right Configuration Options property page, configure it as shown below to print the data on the Serial Console at 9600 baud rate.
    Figure 5-14. Altering the PAD and Baud Rate in SERCOM1
  11. After configuring the peripherals, as shown in the following figure, click Generate under Project Resources.
    Figure 5-15. Generation of Code
    Note: SERCOM5 is connected to EDBG USART lines through which the SAM D21 Curiosity Nano Evaluation Kit will communicate with the PC terminal application.
  12. The main.c file will be generated and the logic of the application can be implemented.