How to use DMA on 8 bit PIC® MCUs
Вставка
- Опубліковано 8 лют 2025
- Learn how to use and setup Direct Memory Access (DMA) on PIC microcontrollers. This video provides a detailed walk through of how to set up DMA with analog-to-digital converter (ADC), system communications (UART), and waveform control (PWM) using the MCC GUI provided in MPLABX. See resources and source code below:
Source Code:
part 1 - github.com/mic...
part 2 - github.com/mic...
Hardware:
PIC18-Q43 Family: mchp.us/2QZOWV6
DMA Peripheral Overview: mchp.us/39AiqiG
Curiosity Nano PIC18F57Q43: mchp.us/2X0KmcI
Curiosity Nano Baseboard for Clicks: mchp.us/3bJe6PK
Software:
MPLABX [v5.30 or later] - mchp.us/2QYLOZq
XC8 [v2.10 or later] - mchp.us/2UU1Zs1
MCC [v3.95 or later] - mchp.us/3aAxdel
PIC10/12/16/18 Library [v1.79.0 or later]
Documentation:
TB3242: Configuring the DMA Perhiperal - mchp.us/3aygqJa
AN3312: Arbitrary Waveform Generator Using DAC and DMA - mchp.us/2wKTwzH
AN3382: ADCC Context Switching Using DMA - mchp.us/2w5kC45
AN3398: Building Hardware State Machines Using CIPs - mchp.us/2UwHWB0
www.microchip....
Thank you at least it gives an insight on the DMA topic.
This is a Good video from Microchip. But I feel it is better if usage examples of all peripheral is given as code examples.
No broken dreams! Thanks
it worked after i realized that only analog will work without any modifications only on A0. MCC does not realize that i selected another pin (C2 as example) and select that channel instead of 0x00.
Would like such a video for USB to SPI
Hi there, thanks for your comment! Please take a look at this video and let us know if it helps: ua-cam.com/video/xrtFpslyamU/v-deo.html
@@MicrochipTechnology I already have a PIC24 and would like to add this functionality among all the other things that it already does
How to Learn MPLAB X IDE and MPLAB IPE software
Can you do just a printf to uart dma? Not sure what the source would be
Hi Stephen - Thanks for reaching out with your question! Yes, you can use DMA with a printf function for UART on 8-bit PIC® MCUs. The source would typically be a memory buffer containing the data you wish to print. Ensure DMA is properly configured to read from this buffer and transmit via UART. For detailed guidance, refer to the specific MCU's datasheet. Let us know if you have more questions about this!
Multiple PWM maybe?
Is this like a poor mans RTOS? Or is DMA different?
DMA and RTOS are two different things. If I would be to explain it shortly - DMA is only for transferring data in a background, without CPU involvement nor any kind of code execution.