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

NRF52840 SPIM3

Hi,

I am using the 2 NRF52840 boards, rev 1.  I am using SDK 15.2.  The first board is running the NRFX_SPIM example.  The second board is running the SPIS example.  The rx_delay is set to 0x02.

When I configured the SPIM to run at 4MHz.  The SPIM and SPIS sometimes get the correct message.  and sometimes get data value of all F's.

When I configured the SPIM to run at 32MHz.  The SPIM and SPIS received data is always incorrect.

Any ideas?  Has anyone tried using the NRFX_SPIM and SPIS example projects together?

Thanks,

SPIM configured to run at 4MHz result.  Below is the result from the SPIM.

0> <info> app: Transfer completed.
0> <info> app: Received:
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF |.....
0> <info> app: Transfer completed.
0> <info> app: Received:
0> <info> app: FF 4E 6F 72 64 69 63 31|.Nordic1
0> <info> app: 32 33 34 35 36 37 38 39|23456789
0> <info> app: 30 31 32 33 34 35 36 37|01234567
0> <info> app: 38 39 30 31 32 33 34 35|89012345
0> <info> app: 36 37 38 39 30 |67890
0> <info> app: Transfer completed.
0> <info> app: Received:
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF |.....
0> <info> app: Transfer completed.
0> <info> app: Received:
0> <info> app: FF 4E 6F 72 64 69 63 31|.Nordic1
0> <info> app: 32 33 34 35 36 37 38 39|23456789
0> <info> app: 30 31 32 33 34 35 36 37|01234567
0> <info> app: 38 39 30 31 32 33 34 35|89012345
0> <info> app: 36 37 38 39 30 |67890

Below is the result of the SPIM when configured to run at 32MHz.

0> <info> app: Transfer completed.
0> <info> app: Received:
0> <info> app: FF FF FF DF E5 C9 D3 C7|........
0> <info> app: 63 64 67 68 6A 6C 6E 38|cdghjln8
0> <info> app: 39 30 31 32 33 FF FF FF|90123...
0> <info> app: FF FF B9 B0 B1 B2 B3 B4|........
0> <info> app: B5 B6 B7 B8 B9 |.....
0> <info> app: Transfer completed.
0> <info> app: Received:
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF FF FF FF|........
0> <info> app: FF FF FF FF FF |.....

Below is the result of SPIS when configured to run at 32MHz.

Transfer completed

0> <info> app: 6F 72 64 69 63 31 32 33|ordic123
0> <info> app: 34 35 36 37 38 39 30 31|45678901
0> <info> app: 32 33 34 35 36 37 38 39|23456789
0> <info> app: 30 31 32 33 34 35 36 37|01234567
0> <info> app: 70 72 60 |pr`

Transfer completed
0> <info> app: 37 B9 32 34 B1 98 99 19|7.24....
0> <info> app: 9A 1A 9B 1B 9C 1C 98 18|........
0> <info> app: 99 19 9A 1A 9B 1B 9C 1C|........
0> <info> app: 98 18 99 19 9A 1A 9B 1B|........
0> <info> app: 9C 1C 98 |...

Parents
  • Thank you for everyone help.

    At this point, I can only get 2 NRF52840 boards to work at 16MHz reliably.  At 32MHz, the SPIM works good, but the SPIS MISO signal get corrupted.  I am not sure it's a driver issue or hardware limitation at this point.

    Below is the performance result that I measured.

    Nordic NRF52840 16MHz Performance Results

    29.9

    Hz Frame

    65535

    bytes per frame

    1959496.5

    byte per second

    600

    us frame gap

    I wish I can get the 32MHz working too.  It would probably also increase the throughput by double.

    Overall the performance is decent and it's probably the best SPI I have seen.

    Thank you again for everyone help.

Reply
  • Thank you for everyone help.

    At this point, I can only get 2 NRF52840 boards to work at 16MHz reliably.  At 32MHz, the SPIM works good, but the SPIS MISO signal get corrupted.  I am not sure it's a driver issue or hardware limitation at this point.

    Below is the performance result that I measured.

    Nordic NRF52840 16MHz Performance Results

    29.9

    Hz Frame

    65535

    bytes per frame

    1959496.5

    byte per second

    600

    us frame gap

    I wish I can get the 32MHz working too.  It would probably also increase the throughput by double.

    Overall the performance is decent and it's probably the best SPI I have seen.

    Thank you again for everyone help.

Children
  • Thanks for posting the results; given that the implied SPIS figure is only about 8MHz it's pretty impressive we can use 16MHz.

    So I have an idea how you can get 64MHz SPI between 2 x nRF52840 DK boards, any interest in that? The trick is to use QSPI on the master, and 4 x SPIS on the slave. The 4 x Slave SPI all share SCK, MOSI and CS input signals, but each SPI MISO connects to one of the QSPI inputs on the master. Should work .. not tried it yet though. Our requirement is to get data off as fast as possible, and 64MHz is pretty fast.. QSPI Master is rated at 32MHz, but as we have found only 16MHz is usable on SPIS, so 4 x 16=64MHz :-)

    I should add that we don't care about having to de-interlace the data, as it ends up on a much faster desktop.

Related