• AVR Freaks

Hot!Harmony v3 : SPI in slave mode and DMA

Author
Deenayd
Super Member
  • Total Posts : 905
  • Reward points : 0
  • Joined: 2004/09/08 06:15:13
  • Location: Poland
  • Status: offline
2019/05/08 00:43:22 (permalink)
0

Harmony v3 : SPI in slave mode and DMA

Hello,
 
I have been using smaller PICs since years, now I need to use PIC32MZ to get more processing power.
 
I have just installed Harmony v3 (v3.3.0 if I'm not mistaken).
Created new project with PIC32EF starter kit (pic32mz2048efm144 processor).
Project graph opened.
 
I need three communication channels:
- outgoing master SPI to configure smaller processor that works as signal generator (can't accept jitter in generated signals so this processor works without PLL)
- incoming slave SPI with DMA to accept incoming data from external high-end ADC chip
- outgoing bit bangled data channel that adapts it's work to what I get from ADC
 
SPI communication from ADC goes through optos as it has separate power supply to get best accuracy. Optos create delays so I pass both clock and data through it, to get similar delays. This means I need to use SPI in slave mode in pic32mz.
 
So in Project graph I add following components:
- core
- freertos (I'm not usre if I'd need it, but adding core asks me to add an rtos)
- EF starter kit BSP
- SPI driver (set it to 2 instances)
- SPI1
- SPI2
 
I add a link beetween SPI driver instances and SPIs from peripheral library.
I enable DMA in SPI instance 1, it links automatically to channels 0 and 1.
I open SPI2 (linked with driver instance 1) and... master mode enable bit is forced to: master mode.
 
How can I switch it to slave mode?
 

Slawek Piotrowski
Rejestracja Czasu Pracy Ewidencja Czasu Pracy
#1

2 Replies Related Threads

    Deenayd
    Super Member
    • Total Posts : 905
    • Reward points : 0
    • Joined: 2004/09/08 06:15:13
    • Location: Poland
    • Status: offline
    Re: Harmony v3 : SPI in slave mode and DMA 2019/05/09 05:31:33 (permalink)
    0
    Ok, fortunatelly this is new porject. Just switched to harmony 2.06.

    Slawek Piotrowski
    Rejestracja Czasu Pracy Ewidencja Czasu Pracy
    #2
    arpananand
    Super Member
    • Total Posts : 403
    • Reward points : 0
    • Joined: 2009/11/18 04:35:42
    • Location: 0
    • Status: offline
    Re: Harmony v3 : SPI in slave mode and DMA 2019/05/13 21:09:54 (permalink)
    0
    @deenayd in H3, currently SPI slave mode is not supported, that's why option is fixed to master mode.
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5