One wire problems

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

User avatar
Jan Lichtenbelt
Posts: 794
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 261 times
Contact:

One wire problems

Postby Jan Lichtenbelt » Tue Jul 09, 2019 11:33 am

I use the temperature sensor DS18S20 with the Flowcode as given in wiki:
https://www.matrixtsl.com/wikiv7/index.php?title=Component:_One_Wire_(Comms:_Interface)
I changed the microchip into 16F1847 with pin A7 for the one-wire communications. This pin has a 4k7 resistance connected to 5V.
This is as simple as possible. But I get the message "no device found". I took another sensor, but with the same result.

But Flowcode gave the error:
Test_SingleOneWire_V1.c: FCD_0bbd1_OneWire1__Get_Next_ID()
729: break;
^ (345) unreachable code (warning)
. . . . . .


Is this the problem? Or something else?

Kind regards

Jan
Test_SingleOneWire_V1.fcfx
(12.48 KiB) Downloaded 20 times


Added: Changing the output pin from A7 to A4 makes the microchip to detect the DS1820 sensor, but gives a CRC error. Still not clear what happens?

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: One wire problems

Postby kersing » Tue Jul 09, 2019 10:11 pm

You can ignore the warning, that will be issued in working setups as well.
The 1 wire component is extremely timing critical. Make sure to get oscillator set to highest possible speed and Flowcode set to the correct click so it can calculate the delays correctly.
These users thanked the author kersing for the post:
Jan Lichtenbelt (Wed Jul 10, 2019 10:40 am)
Rating: 5.26%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
Jan Lichtenbelt
Posts: 794
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 261 times
Contact:

Re: One wire problems

Postby Jan Lichtenbelt » Wed Jul 10, 2019 10:42 am

Hi Kersing

Thanks a lot for your advise. I changed to microchip 16F18857 with 32 MHz oscillator. Now I get the temperature reading of 85.0 C, which does not change in time. It is not (yet) that hot here in the Netherlands.
What can I do now?

Kind regards

Jan

User avatar
Jan Lichtenbelt
Posts: 794
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 261 times
Contact:

Re: One wire problems

Postby Jan Lichtenbelt » Wed Jul 10, 2019 11:15 am

Hi Kersing

I tried more DS1820 samples. The third is working fine now. Indeed a rather crital IC.

Kind regards

Jan