This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to transfer data from nRF52840DK to raspberry pi 4 without deploying bluetooth ble5 ?

hello

i want to send the data from my 5 of nRF52840DK to 1 of raspberry pi4  , i known the nRF52840dk has built-in bluetooth ble5 and raspberry pi 4 also integrate bluetooth ble5 as well

BUT i do not want to send data with the bluetooth channel ,**  i want to transfer or send data from 5 nRF52840dk to 1 raspberry pi 4  WITH CABLE ** via GPIO pin or UART or SPI , i do not  know much about those , 

 how to send data from 5 nrf52840dk to 1 raspberry pi 4 with cable connection ?

  • Hi

    On the Raspberry Pi side of things you'll have to find code yourself, but on the nRF side we do indeed have for example UART and SPI that can help you transmit data over a wired connection. From your previous cases I assume you're looking at using the nRF5 SDK, so here are some links to the UART and SPI peripheral example projects from the nRF5 SDK. It's up to you which one you'd like to use, but the SPI would allow for the highest throughput.

    Best regards,

    Simon

  • thanks ,

    after getting your answer , i did research on the internet , about the method to send data between I2C  or UART or SPI , i found that the SPI is the best way in order to send data  .

    SPI is superior in speed compared to I2C. Its push-pull drivers offer enhanced speed and signal integrity and its full-duplex support means master and slave devices can send data at the same time, allowing for even quicker data exchanges. While SPI has a speed advantage, it is more difficult and costlier to add multiple slave devices to the bus. This is because each slave needs its own slave select line, so the number of wires needed to communicate increases with each device.

    i found the youtube video about how to learn SPI data transferring

    https://www.youtube.com/watch?v=RRUH_VHNocU&list=PLiKJljyEUlZj4z8RqJKTaoMpSqjLdBGO4&index=40

    however my case need to send data from ( 5 units of nRF52840DK ) to  ( one of raspberry pi 4 )

    i have 3 questions below to ask you

    question 1 ---> i think in term of master and slave  , my 5 nrf52840dk should be as 5 slaves and my one master is one raspberry pi 4 , am i understanding correctly ?

    question 2 ---> is it still ok to send data with SPI ** IN MY CASE  ** that need to send data from 5 nrf52840dk to one raspberry pi 4 ??  or need to use other way as uart or i2c instead ?

    question 3 --->  regarding to the learning spi video from youtube , do you have other guideline video that teach how to deploy spi of nrf52840dk ?

  • Hi again

    1. Yes, I would recommend the nRFs acting as slaves and the Raspberry as the master.

    2. You should make sure that the Raspberry has enough SPI instances though, or else it won't be able to communicate with all five nRF52 DKs at the same time. From what I can see here, this won't be a problem as it seems to have 7(!) SPI instances SPI0-SPI6. Each DK should be connected to its own set of GPIOs that are configured to one SPI instance each.

    3. Sumair's tutorial videos are pretty good, and I see that he has a part 36 B going deeper into how using SPI communication here. We don't have much official tutorials on basic SPI projects, as the SPI slave example and driver documentation should be sufficient.

    Best regards,

    Simon

  • very thanks from your answer

    about the raspberry pi 4 multiple spi is the good choice as your link , however i do not have it in my hand now ,cause the raspbery pi 4 sold out from online store from official raspberry pi 4 website

    question 1 . --> my case after watching the youtube video from sumair 's tutorial , he said , the wire cable max length should be not over 3 feet (90 cm) **** my case is 120 - 150 cm or 4 - 5 feet  max length ,  is it still ok with the length 4 - 5 feet -->between raspberry pi and nRF52840dk ??

    question 2  --> https://www.adafruit.com/product/4292 ---> regarding to  this link , i am not sure . i do not know the raspberry pi 4 model B 2 GB as you see in this link , it will be RASPBERRY PI 4 MULTIPLE SPIs  that has 7 SPIs as your previous answer  or  not ??

  • Hi

    1. The rule of thumb when it comes to length between wired connections is to "keep it short and simple", or KISS for short. I would strongly recommend trying to find shorter wires than 120cm, and preferably as short as possible, as that will minimize the chances for lost data. It will likely work with 120cm I would think, but by getting shorter wires you will likely save yourself from lost data packets and retransmissions.

    2. Indeed, their product page does not say much on how many peripherals/instances they have, but from what I can find (here for example) it seems to have 7 SPI instances. To make sure I would suggest contacting either Raspberry Pi or a distributor that would know for sure.

    Best regards,

    Simon

Related