Harmony v3 Drivers and System Services on SAM E70/S70/V70/V71: Step 2
Configure Timer System Service
Under the bottom left Available Components tab, expand Harmony > System Services.
Double-click or drag and drop Time to add the Timer System Service to the project graph.
A popup window will appear, select the option as shown in the accompanying image.
Associate the Timer System service to Timer Instance 0 (TC0) by right-clicking on the red diamond as shown in the accompanying image.
Select TC0 Peripheral Library and notice the default configuration by expanding Channel 0.
Configure I²C Driver and I²C pins
Under the Available Components tab, expand Harmony > Drivers.
- Select and double-click on I²C to add the I²C driver to the project.
- Associate I²C driver with I²C instance 0 (TWIHS0) peripheral by right clicking on the red diamond.
- Click on Instance 0 under I2C Driver to view the Configuration Options. Change the Number of Clients to 2.
- Select TWIHS0 Peripheral Library and notice the default configuration by expanding Hardware Settings.
Open the Pin Configuration tabs by clicking MHC > Tools > Pin Configuration.
Select the MHC Pin Settings tab and sort the entries by Ports as shown in the accompanying image.
Now, select the MHC Pin Table tab and then scroll down to the TWIHS0 module as shown in the accompanying image.
- Enable I²C Clock (TWIHS0_TWCK0) on PA04 (Pin #77)
- Enable I²C Data (TWIHS0_TWD0) on PA03 (Pin #91)
Configure Universal Synchronous Asynchronous Receiver Transmitter (USART) Driver and USART pins
Under the Available Components tab, expand Harmony > Drivers.
- Double-click on USART to add the USART driver to the project.
- Associate USART Driver with USART instance 1 (USART1) peripheral by right clicking on the red diamond.
- Click on Instance 0 under USART Driver to view the Configuration Options. Select the Use DMA for Transmit check box.
- Select the USART1 Peripheral Library in the Project Graph and configure it for USART protocol, including setting the baud rate to 115200 Hz.
Select the Pin Table tab and then scroll down to the USART1 module as shown in the accompanying image.
Enable USART_TX on PB04 (Pin #105).
Enable USART_RX on PA21 (Pin #32).