5 Building and Debugging the Application

  1. The PIC32CZ CA90 Curiosity Ultra Development Board supports debugging using an Embedded Debugger (EDBG). Connect the Type-A male to micro-B USB cable to the micro-B USB port on the PIC32CZ CA90 Curiosity Ultra Development Board and connect the Type-A male end to the PC. Additionally, connect an external power supply (6.5V-14V) to power up the board.
    Figure 5-1. Hardware - PIC32CZ CA90 Curiosity Ultra Development Board
  2. Short the MISO (PC11 – Pin 17) and MOSI (PC08 – Pin 16) pins present in EXT1 in the PIC32CZ CA90 Curiosity Ultra Development Board using a wire.
    Figure 5-2. Hardware Setup - PIC32CZ CA90 Curiosity Ultra Development Board
  3. Connect the Type-A male to the micro-B USB cable to the micro-B debug USB port to power and debug the SAM E70 Xplained Ultra Evaluation Kit.
    Figure 5-3. Hardware - SAM E70 Xplained Ultra Evaluation Kit
  4. Short the MISO (PD20 – Pin 17) and MOSI (PD21 – Pin 16) pins present in EXT1 in the SAM E70 Xplained Ultra Evaluation Kit using a wire.
    Figure 5-4. Hardware Setup - SAM E70 Xplained Ultra Evaluation Kit
  5. Select the Tx variable in the code and right-click on the selected text, then select New Watch.
    Note: Follow the same for Rx.
    Figure 5-5. Adding a New Watch
  6. In the MPLAB X IDE Project Properties window perform these actions.
    1. Under the left Categories section, select Conf: [default], and in the right Configuration properties page, select the Connected Hardware Tool and Compiler Toolchain as shown below.
    Figure 5-6. Project Properties - PIC32CZ CA90 Curiosity Ultra Development Board
  7. For SAM E70 Xplained Ultra Evaluation Kit, the hardware tool needs to be changed as follows.
    Figure 5-7. Project Properties - SAM E70 Xplained Ultra Evaluation Kit
    Note: The following steps are applicable for both the boards (the PIC32CZ CA90 Curiosity Ultra Development Board and the SAM E70 Xplained Ultra Evaluation Kit).
  8. Click Apply and then click OK.
  9. Click on the highlighted position as shown below to put a breakpoint.
    Note: Breakpoint is used in the reception transfer handler to visualize the received data.
    Figure 5-8. Adding the Breakpoint in Reception Complete
    Figure 5-9. Breakpoint on Receive Complete Callback
  10. Click on the Debug main Project button.
    Figure 5-10. Debug Main Project
    Note: If the Variable window does not appear, go to Window > Debugging > Variables to open the Variable window.
    Figure 5-11. Window Menu details
    Figure 5-12. Variables Window
  11. The transmitted data (Tx) matches with the received data (Rx).
    Figure 5-13. Output