One Wire Fails

A forums to allow resolved bugs and problems with Flowcode v7 to be stored and marked as resolved.

Moderator: Benj

Post Reply
johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

One Wire Fails

Post by johnsondav »

HI everyone

I have been trying to get this 'One Wire - DS18B20' component to work on my project without success. It worked using FC5. So, I have downloaded the sample Single One Wire Demo and tried to compile that using FC7, same problem. This is what the compiler reports using the Demo file:
Registered to: johnsondav
Licence key: XXXXXX
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=16F1937 "SingleOneWire.c" --MSGDISABLE=359,1273,1388
SingleOneWire.c: FCD_0bbd1_OneWire1__Get_Next_ID()
637: break;
^ (345) unreachable code (warning)
.

Memory Summary:
Program space used B26h ( 2854) of 2000h words ( 34.8%)
Data space used B4h ( 180) of 200h bytes ( 35.2%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 110h bytes ( 0.0%)
Configuration bits used 2h ( 2) of 2h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)

Microchip MPLAB XC8 C Compiler (Free Mode) V1.36
Build date: Jan 14 2016
Part Support Version: 1.36
Copyright (C) 2016 Microchip Technology Inc.
License type: Node Configuration
The unreachable warning prevents the device from allowing data been read by the PIC. I have checked to see if the bus is active using a scope and data is clearly been sent on the bus, either from the PIC or from the device. Not sure which, the scope does not show this. However, the read-out is always zero. Any help would be greatly appreciated.

Dave

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: One Wire Fails

Post by Benj »

Hi Dave,

Please can you attach your flowcode project file and we will take a look for you.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: One Wire Fails

Post by johnsondav »

Hi Benj

Thanks for having a look. However, its not just my project its also the Demo component program as well.
SingleOneWire.fcfx
(10.52 KiB) Downloaded 385 times
I can not get either demo or project to work. with this component.

Dave

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: One Wire Fails

Post by johnsondav »

Hi Benj

I have done a bit more experimental work to try and find what specifically is going wrong. It appears to me, all though I am no expert, that with the modification to the Demo program, the error is with the CRC element of the compiler. Therefore, I have switched to the XC8 Ver 1.38 compiler which has some updates to the CRC in Ver 1.37 release. This has not change the end result. I am still getting the zero result displayed or with the CRC branch enabled in the demo file 'CRC error' displayed.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: One Wire Fails

Post by Benj »

Hello,

I have just tried the example from the URL below on a 16F1937 running at 19.6608MHz and it seems to be working fine in v7 to read a DS18S20+ sensor.

http://www.matrixtsl.com/wikiv7/index.p ... 82b7c71023

Are you powering the sensor or using the parasitic power option?
SingleOneWire.c: FCD_0bbd1_OneWire1__Get_Next_ID()
645: break;
^ (345) unreachable code (warning)
This is normal and can be ignored.

johnsondav
Posts: 188
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 86 times
Been thanked: 186 times
Contact:

Re: One Wire Fails

Post by johnsondav »

Hi Benj

My sincere apologies. The fault is all mine. The chip I am using is a PIC18F4550 and the compiler warning through me to believe the compiler had not done as I wanted. However, that is not the case as every thing is working once I made a change to the crystal clock settings. Communication to the DS18B20 is now working correctly. The PIC18F4550 has a PLL clock which MUST be setup correctly before the timings are correct for this device. At least that's what I think was wrong.

Once again, thank you and sorry to have wasted your time. A bit more learned.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: One Wire Fails

Post by Benj »

Brilliant, glad it's working correctly for you now.

Ulises72
Posts: 5
Joined: Tue Feb 04, 2014 8:15 pm
Location: Mexico
Contact:

Re: One Wire Fails

Post by Ulises72 »

Hi Johnsondav, can you tell me how to configure the 18F4550 chip so that the DS18BB20 will work? I have the problem of CRC error, I have this bug in version 7 and 6, in version 5 it works very well.

regards

Post Reply