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

Migrating a design from Raspberry pi Zero to nRF9160 DK - Need I2C and SPI interfaces

Hi,

I have developed a simple system based around a Raspberry Pi Zero. The system uses a couple of sensors to measure temperature and water pressure using a ADS51115 A/D and a MAX 31865 RTD to digital convertor. These connect to the Pi zero via the !2C bus and the SPI interface. I would like to replace the Pi zero with the nRF9160 dev board, can some one point me to some example hw and sw that will enable me to quickly convert. Thanks, Rod

  • Thanks Jan,

    OK, I have created an overly file, nrf9160_pca10090.overlay and have added the code as detailed in your message above. This is in my application directory

    Watts-MacBook-Pro:BME280_Test_Code Watt$ ls

    CMakeLists.txt prj_spi.conf

    build sample.yaml

    nrf9160_pca10090.overlay src

    prj.conf

    When I try to build

    cmake -GNinja -DSHIELD=nrf9160_pca10090 -DBOARD=nrf9160_pca10090 ..

    I get an error

    Zephyr version: 1.14.0

    -- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.7.3", minimum required is "3.4") 

    -- Selected BOARD nrf9160_pca10090

    No shield named 'nrf9160_pca10090' found

    Any ideas?

  • Hi,

    I might be misunderstanding here, but it looks liek you're trying to use another nRF91 DK as a shield. If you build without the -DSHIELD option, this should work. If you have a (BME280?) shield connected to your board, you can create an overlay with its name like you did for the board. Then you can feed the shield name into the build system using -DSHIELD. 

    Please correct me if I'm not understanding what you want to achieve.

    Best regards,

    Jan Toe

  • Hi Jan,

    Replying to this as your latest comments don't have an associated reply button.

    Yes, I am connecting the BME280 to the 9160 DK. As per your previous reply, I created an overlay file, which I called nrf9160_pca10090.overlay and added the I2C and SPI code above.

    I then try to build this with the command

    cmake -GNinja -DSHIELD=nrf9160_pca10090 -DBOARD=nrf9160_pca10090 ..

    I get an error

    Zephyr version: 1.14.0

    -- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.7.3", minimum required is "3.4") 

    -- Selected BOARD nrf9160_pca10090

    No shield named 'nrf9160_pca10090' found

    So, are you suggesting that I create a shield called BME280.overlay which contain the I2C and SPI code above and then build using

    cmake -GNinja -DSHIELD=BME280 -DBOARD=nrf9160_pca10090 ..

    Regards,

    Rod

    Sorry, I thought I ad replied to this earlier, but my replay seems to have disappeared. 

  • Hi,

    I'd just remove the -DSHIELD altogether, as you've already added the BME280 to the PCA10090 overlay. You can also define which pins to use as shown in an earlier reply in this thread in that same overlay. The alternative is as you mention to add an overlay called bme280.overlay and set -DSHIELD=bme280.

    Regards,

    Jan Tore

Related