DS18B20 x2 Ports x2 One Wire x2

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
darrynenig22
Posts: 8
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:18 pm

Flowcode v10 DS18B20 x2 Ports x2 One Wire x2

Post by darrynenig22 »

Hi,

Please can you help with the connecting x 2 DS18B20 to separate ports pins, Only one is working and showing the tempeature value in hardware and the other is static at 85
I have tested both with separate V10 code on the port A.0 and C.0 and both probes work fine in hardware.
Not sure if the problem is the reference for x2 DS18B20 and x2 One wire at the same time.


Thanks Darryn
Attachments
DS18B20 x2 Ports x2 One Wire x2 .fcfx
(25.51 KiB) Downloaded 101 times

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: DS18B20 x2 Ports x2 One Wire x2

Post by mnfisher »

One thing to check - you initialise the ds18b20 sensors and then the one-wire component. Since the sensor initialisation uses the one-wire component this should be the other way around.

Martin

darrynenig22
Posts: 8
Joined: Wed Dec 02, 2020 10:18 pm

Re: DS18B20 x2 Ports x2 One Wire x2

Post by darrynenig22 »

Hi
Have swapped the one wire component and then the DS18B20 initialisation order but the second instance of the DS18B20v2 showing 85 in hardware.
If I remove 1 set so only single DS18B20 on the port C.0 or A.1 both work individually.
Another observation the new 2d panel does not show the link between the two components where the legacy 3d has the connection shown.

Any thing else that I can try.
Thanks Darryn

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: DS18B20 x2 Ports x2 One Wire x2

Post by BenR »

Hello,

I've looked into this for you and I can see why there is a problem. It's a bug I've not seen before so I'll try and chase it through and work out why it's happening. Basically one of the DS18B20 components is calling the internal macros of the other DS18B20 which is very bizarre.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: DS18B20 x2 Ports x2 One Wire x2

Post by BenR »

Hello,

Many thanks for letting us know of the problem.

Hopefully should be fixed for you now via an update using the Help -> Library updates menu.

darrynenig22
Posts: 8
Joined: Wed Dec 02, 2020 10:18 pm

Re: DS18B20 x2 Ports x2 One Wire x2

Post by darrynenig22 »

Thanks Ben,

That worked for the two probes connected so continued with three and also working just fine. All three stable and converting to temperature on the LCD
But the 4 x probes test has an issue with the port pin C.7 and no temperature showing on the hardware test.
The port C.7 is working with v5 for single connection and multiple x4 connections but not with v10, Any thoughts for this.
Thanks Darryn
Attachments
DS18B20 x4 Ports x4 One Wire x4.fcfx
(37.81 KiB) Downloaded 81 times

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: DS18B20 x2 Ports x2 One Wire x2

Post by BenR »

Hello,

I guess the problem now is to do with pin C7 and not the fact you've got 4 sensors. Looking at the code generated it all seems to be correct now anyway which is good.

So far I've not spotted anything that would cause C7 not to work, it might be worth checking you can use C7 as a simple digital output (LED) and input (switch) without any problems. It might also be worth double checking connections to make sure there isn't an open or a short on the fourth sensor.

darrynenig22
Posts: 8
Joined: Wed Dec 02, 2020 10:18 pm

Re: DS18B20 x2 Ports x2 One Wire x2

Post by darrynenig22 »

Hi Ben,
Specifically C.7 is the problem with v10, hardware always works with perfect results with v5 flowcode. C.7 tested with probes and working as digital and v.


Any combination and ordering of the v10 code will always have the C.7 port not converting, Can you check the defines for the PIC18F66K22

tested
Thanks Darryn

darrynenig22
Posts: 8
Joined: Wed Dec 02, 2020 10:18 pm

Re: DS18B20 x2 Ports x2 One Wire x2

Post by darrynenig22 »

Hi Ben,
Can you take a look at the one wire component and coms to find out why port C.7 fails to return the temperature,
The hardware works with 1 wire code from flowcode v5 on C.7 port and not working with v10

Thanks Darryn

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

Re: DS18B20 x2 Ports x2 One Wire x2

Post by celebriums »

Yes dear Medelec;
Dt=976ms There's a 25 ms difference compared to the oscilloscope.
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 3308 times

Post Reply