DS18B20 Data read error

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
celebriums
Posts: 10
http://meble-kuchenne.info.pl
Joined: Fri Dec 18, 2020 7:33 am
Has thanked: 7 times

DS18B20 Data read error

Post by celebriums »

Please note that everyone warm greetings from Istanbul.

In Flowcode 9, I think there is a temperature reading error with DS18B20.
I created the attached software by making sample code.

I am using PIC16F1516 processor and DS18B20+, DS18B20 component is connected to Port C7 with one wire.

When 12 bit resolution is selected, it shows a constant value of -0,0625 on the screen. The value never changes.
When 11 Bit resolution is selected, it shows a constant value of -0,1 on the screen. The value never changes.
When 10 Bit resolution is selected, the display shows a constant value of -0,2. The value does not change at all.
When 9 Bit resolution is selected, it shows a constant value of -0,5 on the screen. The value does not change at all.nce parallel FETs have been chosen in this design, schematic and PCB export features will not work
Attachments
Snap 2023-12-01 at 12.31.54.png
Snap 2023-12-01 at 12.31.54.png (215.81 KiB) Viewed 3241 times
WhatsApp Görsel 2023-12-01 saat 12.43.29_923d8beb.jpg
WhatsApp Görsel 2023-12-01 saat 12.43.29_923d8beb.jpg (80.2 KiB) Viewed 3241 times
WhatsApp Görsel 2023-12-01 saat 12.43.19_cae7ff70.jpg
WhatsApp Görsel 2023-12-01 saat 12.43.19_cae7ff70.jpg (137.57 KiB) Viewed 3241 times

celebriums
Posts: 10
Joined: Fri Dec 18, 2020 7:33 am
Has thanked: 7 times

Re: DS18B20 Data read error

Post by celebriums »

I can see the data coming and going.
I limited the temperature value on the LCD screen to 4 characters and repeat the reading process at 1 second intervals.
The counter I set up as Intterupt is working properly.
I selected the OSC setting as 0x78 and I use a 16Mhz internal oscillator.

DS18B20 is installed upside down in the picture, but this is not a mistake, it looks like that because I made a mistake in the PCB.

GND comes in Pin 1.
Data input and output on Pin 2,
Pin 3 is Vcc

and a 4.7V supply.
Attachments
motorcontroller.fcfx
(43.48 KiB) Downloaded 86 times

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: DS18B20 Data read error

Post by medelec35 »

Hello.
I have just tested a DS18B20 using your Project file on Flowcode v9.
The only difference target is set for 16F18877.
Temperature is displayed for me as expected.

Have you tried a 1 sec flash test?
Martin

celebriums
Posts: 10
Joined: Fri Dec 18, 2020 7:33 am
Has thanked: 7 times

Re: DS18B20 Data read error

Post by celebriums »

Yes Dear Martin

There's a 24 ms difference compared to the oscilloscope. Could it be this error?
and Im using OSCCON = 0x78;
Attachments
WhatsApp Görsel 2023-12-01 saat 14.50.05_800d029b.jpg
WhatsApp Görsel 2023-12-01 saat 14.50.05_800d029b.jpg (115.95 KiB) Viewed 3231 times
Last edited by celebriums on Sat Dec 02, 2023 9:55 am, edited 1 time in total.

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: DS18B20 Data read error

Post by medelec35 »

I don't think that will be too much of an issue.
Have you tried checking continuity between the pins of the sensor and the microcontroller?
E.g + to +, - to - and signal.
Although you said you can see s data so that should be ok.
Martin

Post Reply