Step 2.1: Configure USART Peripheral Library, USART Pins and USART Peripheral Clock
The USART will be used to print the application debug log and application output.
1
Under the left tab Resource Management (MCC), go to Device Resources and expand Libraries > Harmony > Peripherals > SERCOM.
Click on the symbol beside SERCOM 2 to add the SERCOM instance 2 (SERCOM 2 PLIB) to the project.Associate the STDIO tool to SERCOM instance 2 (USART) peripheral by right-clicking on the yellow diamond.
The USART pins are configured as per the SAM E51 Integrated Graphics and Touch Curiosity Evaluation kit virtual COM Port design.
Step 2.2: Configure Timer System Service with TC0 Timer Peripheral Library (PLIB) and verify its Peripheral Clock
The timer system service is needed to fulfill the shared timer by different tasks in the application.
1
Under the left tab Resource Management (MCC), go to Device Resources and expand Libraries > Harmony > Peripherals > TC.
Click on the symbol beside TC0 to add the Timer Counter instance 0 (TC0 PLIB) to the project.Associate Timer System Service tool to TC0 peripheral by right-clicking on the yellow diamond.
The Timer TC0 and Timer Service default configurations are sufficient to create a shared timer. Also, the timer counter value can able to change in application run time based on the task requirement.
Step 2.3: Configure TC3 Timer Peripheral Library (PLIB) and its Peripheral Clock
The timer TC3 is used to control the display backlight using the Timer compare PWM output.
2
In Clock Easy View, configure the GLCK Generator 4 block as shown below to generate a 1 MHz clock.
Open the peripheral clock configuration by clicking on the Peripheral Clock Configuration button.
Once the window is opened, scroll down to the TC2, TC3 peripheral and set GCLK4 (1 MHz) as the source clock to TC3 peripheral.
4
Select the Pin Settings tab of MCC and configure the pin number 32 (PA15) GPIO Pin as shown here. This pin is configured as per the LCD hardware design of the SAM E51 Integrated Graphics and Touch Curiosity Evaluation kit. This TC3 waveform output will be used to control the LCD BackLight functionality.
Step 2.4: Configure RTC Peripheral Library
The Touch Library uses the RTC timer as a counter, and the default RTC configuration is sufficient for Touch Library.
2
Table of Contents
|