This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52810 SPI PSEL pins wont set & infinite loop

Currently blocked by this issue.

// CFG_PIN_GLUE_DAT = 5

// CFG_PIN_GLUE_CLK = 6

NRF_GPIO->PIN_CNF[CFG_PIN_GLUE_DAT] = pinDisconnectInputBuffer | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
NRF_GPIO->PIN_CNF[CFG_PIN_GLUE_CLK] = (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);

NRF_SPI0->PSEL.SCK = CFG_PIN_GLUE_CLK;
NRF_SPI0->PSEL.MOSI = CFG_PIN_GLUE_DAT;
NRF_SPI0->PSEL.MISO = SPI_PSEL_MOSI_CONNECT_Disconnected << SPI_PSEL_MOSI_CONNECT_Pos; // unused

// WARN - pins appear not be set, see screenshot! Huh?!?

NRF_SPIM0->ENABLE = SPIM_ENABLE_ENABLE_Enabled << SPIM_ENABLE_ENABLE_Pos;

NRF_SPI0->TXD = 15;

while (!NRF_SPI0->EVENTS_READY) {}  // STUCK HERE. Does writing to TXD auto trigger a send?
NRF_SPI0->EVENTS_READY = 0;

Parents Reply
  • I found the debugging issue, I had the nrf52.svd register file selected, a left over. So now the values show up correctly.

    Which leaves the EVENTS_READY not setting. According to the manual this event is flag when TX has shifted out and RX has shifted in. In my case TX is set and RX should be null by the disconnect. Therefore something must be stopping TX from sending.

Children
Related