Step 8: Test Application

Step 8.1 – Verify Correct Operation

1

Disconnect the USB cable. With both boards disconnected, both MCUs will run. When the potentiometer is turned, the LED on the MCU2 demonstration board will adjust its brightness accordingly.

8-bit-PIC-DMA41.png

Step 8.2 – Results

You observed the application read the potentiometer voltage and adjust the LED brightness in relation to its position.

Step 8.3 – Analysis

You have successfully demonstrated DMA functionality using the MPLAB® Code Configurator (MCC). Your project used fundamental DMA elements to move data between peripherals that can benefit almost any application. This demonstration continuously reads the potentiometer voltage, moves data to the UART peripheral for transmission, moves data from another UART after reception, and updates the PWM duty cycle without using a single line of code in the execution loop.

You used MCC to configure the system clock, Timer0 to create a continuous 50 ms trigger, ADC to read the potentiometer voltage, UART to send and transmit data, GPIO for analog and digital modes and input and output operations, PWM to control LED brightness and DMA to move data between peripherals.

Step 8.4 - Conclusions

This tutorial provided you with training for configuring the PIC18F57Q43 DMA using MPLAB X IDE and MCC. As a next step, you can create your own application to suit your needs. Ultimately, if you use another MCU with a DMA, you can explore a similar solution. Note that the configuration would change since the MCU resources will be different.

© 2024 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.