Harmony v3 Drivers and Middleware on PIC32MZ EF MCUs using FreeRTOS: Step 3

Step 3.1: Configure USB High Speed Driver

1

Under the Available Components tab, expand Harmony > Drivers.

  • Double click on USB High Speed Driver to add the USB driver to the project.
usb_driver_select.png
sys_time_activation.png
usb_driver_project_graph.png
  • Click on USB High Speed Driver to verify the default MPLAB® Harmony Configurator (MHC) values.
usb_driver_conf.png
  • Associate SYS_TIME system service with CORE TIMER peripheral by right clicking on the red diamond highlighted below.
core_timer_instance.png
core_timer_linked_project_graph.png
  • Click on SYS_TIME to verify the default MHC values.
sys_time_conf.png
  • Click on CORE TIMER to verify the default MHC values.
core_timer_conf.png

Step 3.2: Configure USB Host Middleware and File System Service

1

Under the Available Components tab, expand Harmony > System Services.

  • Double click on FILE SYSTEM to add the File System Service to the project.
file_system_service_select.png
file_system_linked_project_graph.png
  • Associate the FILE SYSTEM Service with the Mass Storage Device (MSD) Client Driver by right clicking on the red diamond highlighted below.
msd_driver_instance.png
usb_host_activation.png
msd_driver_project_graph_linked.png
  • Click on File System, check the box next to Use File System Auto Mount Feature, and select SYS_FS_MEDIA_TYPE_MSD for Media Type.
file_system_conf.png
  • Click on MSD Client Driver to verify the default MHC values.
msd_client_driver_conf.png
  • Click on USB_HOST to verify the default MHC values.
usb_host_conf.png

2

Select the Clock Diagram tab and configure the USB clock setup as shown below.

  • Enable Primary Oscillator Mode (POSCMOD) as External Clock (EC) mode.
  • Setup Primary Oscillator clock speed as 12 MHz.
  • Select USB PLL Input Frequency Select bit (UPLLFSEL) as 12 MHz.
usb_clock_configuration_setup.png

3

Select the Pin Settings tab, scroll down to GPIO pin RJ13 (Pin Number 28) in the Pin ID column, and configure RJ13 as VBUS_AH to enable USB VBus.

usb_vbus_pin_setup.png

Note: VBUS needs to be enabled manually through a GPIO pin. The USB Host Application Programming Interface (API) periodically checks for VBUS status and VBUS is used to power any connected peripheral by supplying a +5 V voltage from the USB Host.



Next Step >

© 2020 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.