Rapid Prototyping with 32-bit MCU-based Curiosity Nano Evaluation Kit Using MPLAB® Harmony v3 Software Framework: Step 4

Last modified by Microchip on 2023/11/09 09:08

 

Configure Universal Synchronous Asynchronous Receiver Transmitter (USART) Peripheral Library and USART Pins

Under the Available Components tab, expand Peripherals > SERCOM.

Double-click on SERCOM3 to add the SERCOM instance 3 to the project.
 

instance 3 added to the project

Figure 1

Select the SERCOM3 Peripheral Library in the Project Graph, verify that the default SERCOM Operation Mode configuration is set as USART, and configure it.

SERCOM3 Peripheral Library in the Project Graph

Figure 2

Select the Pin Table tab and then scroll down to the SERCOM3 module as follows.

  • Enable USART_TX (SERCOM3_PAD2) on PA24 (Pin #23)
  • Enable USART_RX (SERCOM3_PAD3) on PA25 (Pin #24)
Configure pins 23 and 24

Figure 3

The BM71 XPRO needs two additional pins, one to reset the BLE module and the other to serve as the BM71 RX Indicator.

Configure these PORT pins needed by the BM71 XPRO in the MHC Pin Configurator as follows.

  • Set the Custom Name as "BM71_RX_IND" on PA28 (Pin #27), Direction as Out, and Latch as High.
  • Set the Custom Name as "STBYRST" on PA04 (Pin #04), Direction as Out, and Latch as High.
Configure pins 5 and 27

Figure 4

Under the Available Components tab, expand Tools, and add the STDIO component to the Project Graph. The BM71 driver has a dependency on the STDIO Library to print the logs.

Information

Note: Here you are not connecting a UART (SERCOM), due to a shortage of pins on the PIC32CM MC00 Curiosity Nano Evaluation Kit.

STDIO added to the Project Graph

Figure 5

Back to Top


Associate BM71 Driver

Associate the BM71 driver with the SERCOM instance 3 (USART) peripheral by right-clicking on the yellow diamond.

associating BM71 driver with SERCOM instance 3

Figure 6

SERCOM 3 and BM71 are now associated

Figure 7

Back to Top


Configure Timer and Harmony Core Services

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

Double-click on TIME to add the timer system instance to the project.
 

TIME to added to the project

Figure 8

Information

Note:
1. While adding Timer system service, MHC will pop a message for activating a core service, Click Yes.
2. For FreeRTOS, Click No.

Associate the TIME System Service with the timer instance 0 (TC0) peripheral by right-clicking on the red diamond.

Associate the TIME System Service with the timer instance 0 (TC0) peripheral by right-clicking on the red diamond

Figure 9

Click on Harmony Core Service and configure as shown in Figure 10.

Configure Harmony Core Service

Figure 10

Information

Note: This completes the configuration of UART, BM71 driver, Timer, and Harmony Core Service to interact with the BM71 Bluetooth module for wireless connectivity.

Back to Top