Getting Started with USB on SAM MCUs Using MPLAB® Harmony v3: Step 3
Configure Clocks, Pins, and Application Tasks
Configure Clocks
Open the Clock Configuration pane by navigating to MHC > Tools > Clock Configuration.
![Open Clock Configuration](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/tools_clock_config.png?rev=1.1)
Figure 1: Open Clock Configuration
Switch MOSCSEL to Main Crystal.
![Clock Configuration](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/clock_config_window_1.png?rev=1.1)
Figure 2: Clock Configuration
Configure Pins
Open the Pin Configuration pane by navigating to MHC > Tools > Pin Configuration.
![Open Pin Configuration](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/tools_pin_config.png?rev=1.1)
Figure 3: Open Pin Configuration
Order the pins by Ports for ease of use.
![Order by Ports](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/pin_config_window_1_1.png?rev=1.1)
Figure 4: Order by Ports
The LED on the I/O1 Xplained Pro is connected to pin PA0.
Set the function to GPIO.
- Name this pin as "LED".
- Set the direction to Out.
- Set the latch to High.
TWIHS pins, PA3 and PA4, need to be set to the correct function.
- For PA3, set function to TWIHS0_TWD0.
- For PA4, set function to TWIHS0_TWCK0.
![LED and TWIHS Pin Config](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/pin_config_window_2_1.png?rev=1.1)
Figure 5: LED and TWIHS Pin Config
The LED on the SAM E70 Xplained is connected to pin PC8.
![SAM E70 Xplained User LED Schematic](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/user_leds.png?width=300&height=380&rev=1.1)
Figure 6: SAM E70 Xplained User LED Schematic
- Set the function to GPIO.
- Name this pin as "USB_LED".
- Set the direction to Out.
- Set the latch to High.
![User LED Config](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/pin_config_window_3_1.png?rev=1.1)
Figure 7: User LED Config
Add and Configure Application Tasks
Under Configuration Options, you will find that MHC automatically generates a default application named app. Set the Number of Applications spinbox to 3 and configure each of them as follows:
Expand Application 0 Configuration and rename the default application name to "app_sensor".
- Expand Application 1 Configuration and rename the default application name to "app_eeprom".
- Expand Application 2 Configuration and rename the default application name to "app_usb".
![Configure Application Tasks](/xwiki/bin/download/software-tools/harmony/archive/usb-getting-started-training-module/step3/WebHome/app_tasks_config.png?rev=1.1)
Figure 8: Configure Application Tasks