DS18b20 with PIC16f18426

Carl Arellano's picture

Offline

Joined: Nov 20, 2018

Replies: 2
DS18b20 with PIC16f18426
November 20, 2018 - 9:47am

Hello! I am currently working on my project regarding PIC16f18426 and sensors. I followed the tutorial/sample program you uploaded in interfacing DS18b20 and PIC16f877a. I changed the settings that suits up the device to the microcontroller I used. However, as I put it to the test, it doesn't read anything. What do you think is the problem? Thank you

Jayant's picture

Offline

Joined: May 19, 2015

Replies: 204
Check the timing
November 20, 2018 - 11:05am

As you might have already checked the DS18b20 works with one-wire protocal and here timing is everything. The program given here

https://circuitdigest.com/microcontroller-projects/pic16f877a-digital-th...

is for PIC16F877A and it uses a 20MHz crystal. what is the crystal value in your program.

 

Carl Arellano's picture

Offline

Joined: Nov 20, 2018

Replies: 2
Crystal Value
November 20, 2018 - 11:48am

The crystal value in my program is 32 MHz which  is also used  by PIC16f18426

Sourav Gupta's picture

Offline

Joined: Feb 12, 2018

Replies: 10
Use timer for the timing duration of the sensor.
February 14, 2019 - 1:03am

I think the mcu supports MCC. It is a wiser choice to use timer fuction and create the timing duration for ds18b20. If the timer duration is right, it will definiately work. I have used the sensor a long ago with PIC16F46K22 with a 64Mhz clock cycle.