Do I need to do something special to disable EasyDMA on an nRF52840?

I'm wanting to repetitively read the SPI buffer as a master to check a status bit. I figure there's no sense in using the DMA when I can read the SPI RXD buffer directly.

Another Nordic DevZone question has an answer stating that I can just use the SPI legacy peripheral instead (although only with SPI0-SPI2), which is what I figured. I was just wondering if I had to do anything else to make sure EasyDMA doesn't corrupt any of my RAM, especially given that SPI and SPIM share the same ENABLE register (+0x500).


Also, as I was searching the datasheet while writing this: Am I meant to start the SPI (legacy) peripheral in the same way I would for SPIM (TASKS_START, +0x010)? Wouldn't that add issues with registers like RXD.MAXCNT (+0x538)?

Parents
  • (Unofficial answer) The Enable register is the key; there are 3 enable bits on the nRF52840 which are used 1 bit each for SPI enable, Rx DMA enable and Tx DMA enable. With the Enable register set to 0x0 all are disabled; 0x1 means SPI with no DMA; 0x7 SPIM with both Rx and Tx DMA. DMA-related registers are ignored if DMA enable bits are not set. Want only Rx DMA or only Tx DMA? Guess which Enable bits (0x3 or 0x5) and test.

Reply
  • (Unofficial answer) The Enable register is the key; there are 3 enable bits on the nRF52840 which are used 1 bit each for SPI enable, Rx DMA enable and Tx DMA enable. With the Enable register set to 0x0 all are disabled; 0x1 means SPI with no DMA; 0x7 SPIM with both Rx and Tx DMA. DMA-related registers are ignored if DMA enable bits are not set. Want only Rx DMA or only Tx DMA? Guess which Enable bits (0x3 or 0x5) and test.

Children
Related