Connecting ds18b20 to nrf9160dk

Hi, 

I am looking to connect the ds18b20 sensor to the nrf9160dk. I followed this post, but when I tried running it, I was getting a "create_nordic_project.py failed (1)" saying "error: cmake failed". 

I am a complete beginner when using the development kit so please bear with my questions. 

I have added "CONFIG_GPIO" in the prj.conf file, is there anything else I should be adding. 

Additionally, should I be making changes to the cmake file? The link above only mentioned the .c and .h file so I wasn't sure what else should be changed. 

If anyone could help me with this or could point me to resources that will help me solve this, I would really appreciate it. 

Update : The code is now running without any build errors but not printing any values. I had been using the hello_world sample to run it before which was giving the error, but then I tried switching to the blinky sample and running on that and it's building and running without any errors. (Would anybody know why this is).

My issue now is that it is not printing any values or anything to the Debug terminal on SES or the LTE Link Monitor. Does anyone know why this may be?

Parents
  • Hello Nandini,

    nrffan18 said:
    I think you might have misunderstood.

    My apologies for misunderstanding you.

    nrffan18 said:
    Do you happen to know why this might be?

    I assume that the devicetree configuration for the GPIO is not completely correct. In your main.c, I for instance can’t see that the necessary device binding in the Init_GPIO() function is called. This should at least trigger a warning during compilation, when using a not initialised device with the gpio_pin_configure() function.

    nrffan18 said:
    Additionally I was wondering if you knew how to print to the debug terminal. 

    I recommend you to use the printk command, as illustrated in the Hello World sample.

    nrffan18 said:
    Additionally I noticed that I was not getting 5V output from the 5V pin on the nrf9160dk. Do I need to add a configuration in the prj.conf file to enable this?

    What voltage do you measure on the 5V pin?

    Regards,

    Markus

Reply
  • Hello Nandini,

    nrffan18 said:
    I think you might have misunderstood.

    My apologies for misunderstanding you.

    nrffan18 said:
    Do you happen to know why this might be?

    I assume that the devicetree configuration for the GPIO is not completely correct. In your main.c, I for instance can’t see that the necessary device binding in the Init_GPIO() function is called. This should at least trigger a warning during compilation, when using a not initialised device with the gpio_pin_configure() function.

    nrffan18 said:
    Additionally I was wondering if you knew how to print to the debug terminal. 

    I recommend you to use the printk command, as illustrated in the Hello World sample.

    nrffan18 said:
    Additionally I noticed that I was not getting 5V output from the 5V pin on the nrf9160dk. Do I need to add a configuration in the prj.conf file to enable this?

    What voltage do you measure on the 5V pin?

    Regards,

    Markus

Children
Related