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

Using two SPIM instances - undefined SCK behavior

Hello. In my application I am using nRF5 SDK 15.2.0 9412b96. I am trying to communicate with two devices on two different SPIM instances. The first device is a DW1000 radio placed on DWM1001 module, this is why I have to use two instances for two devices. The problem is with the clock. It behaves very unpredictably. When I use only one SPI instance (i.e. DW receiver is turned off), it seems to work correctly, but when I use both instances, it does not. I tried many different ways to handle the communication. I used sdk's funtcions "nrfx_spim_transfer" in blocking mode, I also wrote some registers-only funtcions. I used my own function for DW communication for months with no issue. Now, when I handle two SPIMs, every time I face the same problem. The clock starts before data is ready to send, the clock ends too early, the clock stops working during transmission and then starts again. Disconnecting the logic analyzer and decreasing bitrate does not change anything. Some of data transfers are valid, but the case is totally random. One thing I noticed is that the transfer is more often corrupted, when previous transfer ended with MISO at 'zero' level. The communication with DW occurs very often, but I am using critical section for every transfer and I've already checked that transfers does not intersect each other. May it be some hardware or chip problem?

Parents Reply
  • I am using Decawave DWM1001 module, where nRF is connected with DW internally. Second SPIM instance is connected to logic analyzer right from the module's pinout, no diodes, no resistors. I wrote a sample project for pca10040 devkit, where only SPIM is used (also two instances) and it looks to work nice, so it seems like it is not a problem with SPIM exactly, but rather with other peripherals colliding. I will try to debug it more deeply, with different peripherals initialized. 

Children
Related