• AVR Freaks

Hot!PIC32MX Data Transfer to SPI Master using DMA with <xc.h> and <sys/attribs.h> files only.

Author
Dennis Bignaman
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2020/02/25 16:08:39
  • Location: 0
  • Status: offline
2020/06/29 20:03:15 (permalink)
0

PIC32MX Data Transfer to SPI Master using DMA with <xc.h> and <sys/attribs.h> files only.

SPI_Using_DMA.c SPI_Using_DMA.c I have successfully used SPI in the past, now I want to use a DMA to transfer 256 data items (32bit) to a SPI Master.  The return data is not used, but from what I understand you have to setup two DMA's.  On for transmit and one for receive.
 
I want to do this using the low level libraries: <xc.h>, <sys/attribs.h>.
 
Thanks for any help appreciated!
 
I have attached example code (that does not work of course ;))
post edited by Dennis Bignaman - 2020/06/29 20:04:53
#1

3 Replies Related Threads

    arpananand
    Super Member
    • Total Posts : 498
    • Reward points : 0
    • Joined: 2009/11/18 04:35:42
    • Location: 0
    • Status: offline
    Re: PIC32MX Data Transfer to SPI Master using DMA with <xc.h> and <sys/attribs.h> files on 2020/06/30 03:08:24 (permalink)
    0
    you can use Harmony 3 PLIBs :)
    #2
    Dennis Bignaman
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2020/02/25 16:08:39
    • Location: 0
    • Status: offline
    Re: PIC32MX Data Transfer to SPI Master using DMA with <xc.h> and <sys/attribs.h> files on 2020/06/30 09:20:29 (permalink)
    0
    That is true.  I wanted to use the SFR's directly to understand more of what is going on.
    #3
    Dennis Bignaman
    New Member
    • Total Posts : 8
    • Reward points : 0
    • Joined: 2020/02/25 16:08:39
    • Location: 0
    • Status: offline
    Re: PIC32MX Data Transfer to SPI Master using DMA with <xc.h> and <sys/attribs.h> files on 2020/06/30 19:22:30 (permalink)
    5 (1)
    After much thought and multiple changes, I have this working!  Yea!
    In case anyone else wants to do something similar I have attached the working code.
    This is PIC32MX250F128B using two DMA channels to transfer data between 2 256 32bit word buffers.
     
     
    post edited by Dennis Bignaman - 2020/06/30 19:24:39
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5