Hi,
I am trying to set up an SPI communication between nordic nrf52 (as a master) and another slave peripheral. I'm using nrf52 sdks 0.9.2. I tried spi master loopback example and spi master with slave example, and both seemed to be working, with the led indicator blinking correctly.
I modified spi master with slave example a little bit, simply commenting out the buff_check() and reducing the transmission & receiving buffer to 2 bytes, so that I could use it to communicate with a slave device. However, I'm not getting any signals back to MISO.
When I checked the spi signals on oscilloscope, they seemed to be distorted and not synchronised with the sclk.
For example:
-
m_tx_data[0] = 0xff; m_tx_data[1] = 0x00;
MOSI, SCLK, CS signals (though clk a bit distorted) seemed to be okay in this case:
-
m_tx_data[0] = 0xaa; m_tx_data[1] = 0xaa; MOSI not synchronised with SCLK.
-
m_tx_data[0] = 0x80; m_tx_data[1] = 0x80; MOSI lagged behind 7 SCLK cycles.
The SCLK actually seemed less distorted if I tested it on oscilloscope alone:
Any suggestions on why this is happening?
Your help will be very much appreciated!
Best Regards. Jiamin:)