This algorithm is not for final decisions, we have GOOD_crc variable for that. Is only to ensure that your application will not be blocked there (maybe we have also other tings to monitor and take decisions) if CRC on a specified sensor is always bad.
On Dec 14, 7:54 pm, "funlw65(Vasi)" <[email protected]> wrote: > More simplified, > > If the maximum number of cycles is achieved (so, we use only one > counter), then really here is a problem. > > On Dec 14, 7:50 pm, "funlw65(Vasi)" <[email protected]> wrote: > > > I will consider that for a future project. Both experiences (yours and > > Vasile's) are of a real value for the community. This kind of things > > we need for good developed libraries, examples and final applications. > > Is pure gold. Thank you! > > > What about this algorithm? > > > ------ start algorithm ------------ > > - In a repeat-until loop, we start two counters. > > - One is measuring the number of cycles, and another is counting the > > number of bad CRC's. > > - We have a maximum (let's say) of 5 or 10 cycles? > > - If at the end of cycles we have the same numbers of CRC errors as > > the maximum number of cycles, then something is WRONG (be it the line > > or the sensor). > > ------ end algorithm ------------ > > > Any opinions? > > > Best regards, > > Vasi > > On Dec 14, 7:28 pm, "jfm68" <[email protected]> wrote: > > > > hi Vasile, > > > > I am a poor farmer who is working his four small probes in +1 to +4°C > > > environnement in a cold room > > > > not like you on the planet Mars with extreme environnement ;-) ! > > > > so Vasi, 1-wire is better in electric-static noise not in cooking mode... > > > > jean Marchaudon > > > > ----- Original Message ----- > > > From: vasile surducan > > > To: [email protected] > > > Sent: Tuesday, December 14, 2010 6:07 PM > > > Subject: Re: [jallib] Re: One wire library > > > > Hi Jean, > > > > I have an automation of three solar water panels (entirely manufactured > > > by myself). I'm measuring temperatures between +80C in summer time to > > > about -25C in winter time on the panel pipes and on the boiler. There are > > > also huge moisture variations on the pipes. I've mounted the 1wire bus > > > cable near the pipes and then add the isolation above the cable and the > > > pipe, so the cable was heated by the pipe itself.... Bad move. > > > The result was an increase of the cable temperature (and it's internal > > > resistance) which creates huge problems on communications, even the cable > > > is only 30m long and 3 sensors on the bus. Problem cured after the cable > > > was taken apart near the pipes. > > > > Vasile > > > > On Tue, Dec 14, 2010 at 8:30 AM, jfm68 <[email protected]> wrote: > > > > hi vasi, > > > > my 1_wire bus work good since 10 years ago without problemes, i use > > > three wires cables 20 metres long and fives probes ds1820 in the same bus. > > > > sometime the crc is bad but one time in my (for 5 loop test) > > > loop...never be bad in my printer control which print all temperature > > > every 15 min since 10 years !! > > > > So your lib is probably good in real condition, because the 1-wire > > > protocole is make for noise environnement. > > > > Have you play with a adressable switch ds2405, it can swicth on/off a > > > relais or read a press-buttom in a 1-wire_bus with multiples probes? > > > > jean Marchaudon > > > > ----- Original Message ----- From: "funlw65(Vasi)" <[email protected]> > > > To: "jallib" <[email protected]> > > > Sent: Tuesday, December 14, 2010 3:08 PM > > > Subject: [jallib] Re: One wire library > > > > My temp sensor is on the learning board (ideal conditions) and not on > > > a long cable which can have radio parasites... I'm missing real > > > conditions. This is why this library must be tested by many, in all > > > kind of conditions. > > > > Also, the library is working with sensors coupled in normal > > > connections (three wires cable) and not in parasitic mode. > > > > Vasi > > > > On Dec 14, 3:58 pm, "funlw65(Vasi)" <[email protected]> wrote: > > > > The GOOD_crc variable is set to 1 when there is a CRC error! Indeed, > > > in the last two procedures from the library, the reading continue > > > in a > > > loop until GOOD_crc will be zero (a good reading). What if no > > > reading > > > will return a good one? How many times we can afford to cycle in > > > that > > > loop? Here experience is needed and I don't have it yet. > > > > The procedures can remain procedures and we can test the GOOD_crc > > > variable status also in the testing programs. > > > > Vasi > > > > On Dec 14, 11:35 am, vasile surducan <[email protected]> wrote: > > > > > Hi Vasi > > > > > On Tue, Dec 14, 2010 at 3:08 AM, funlw65(Vasi) > > > <[email protected]> > wrote: > > > > > The raw temperature on Arduino library is computed like this: > > > > > > int16_t rawTemperature = (((int16_t)scratchPad[TEMP_MSB]) << 8) > > > | > > > > > scratchPad[TEMP_LSB]; > > > > > > Is used a signed word. > > > > > > Look at examples, I think library support also negative > > > temperatures. > > > > > The temperature is computed later, in another procedure and a > > > sign is > > > > > detected... > > > > > I don't want to use signed words since I'm displaying on 7 seg. > > > > Working with words and then converting to BCD is a huge waste of > > > code. > > > > > > For an unique sensor on wire: > > > > > procedure s_temp_18B20(byte out inches, byte out fraction, bit > > > out > > > > > signed) > > > > > On the procedure below, probably there is a problem if CRC is bad, > > > > it remains hang in a repeat-untill loop, right? > > > > I've noticed if the CRC is bad at the first reading it remains > > > bad even > is > > > > read > > > > in a loop. > > > > > procedure s_temp_18B20_CRC(byte out inches, byte out fraction, > > > bit out > > > > > > signed) is > > > > > Did you test the multiple sensors? Usually all kind of nasty > > > things may > > > > appear > > > > when more than 1 sensor is on the bus. > > > > > thx, > > > > Vasile > > > > > > For multiple sensors: > > > > > procedure temp_18B20(byte out inches, byte out fraction, bit out > > > > > signed) is > > > > > procedure temp_18B20_CRC(byte out inches, byte out fraction, > > > bit out > > > > > signed) is > > > > > > Vasi > > > > > > On Dec 13, 2:17 pm, vasile surducan <[email protected]> wrote: > > > > > > On Mon, Dec 13, 2010 at 2:14 PM, funlw65(Vasi) > > > <[email protected]> > > > > > wrote: > > > > > > > Thank you for solution. You mean, JAL is more efficient than > > > > > > > assembler? > > > > > > > Jal is a dream. Use words only.[?] > > > > > > > > I really need to find some time to learn assembler. I did > > > once for > > > > > > > Z80, but I had the required book... don't have it anymore... > > > > > > > > On Dec 13, 2:04 pm, vasile surducan <[email protected]> > > > wrote: > > > > > > > > if sign == high then ; negative temperatures > > > > > > > > assembler > > > > > > > > comf t_lsb,f ;complement all two bytes > > > > > > > > comf t_msb,f > > > > > > > > > incf t_lsb,f ;inc. low byte always > > > > > > > > skpnz ;skip if no carry to higher bytes > > > > > > > > incf t_msb,f ;carry to next byte > > > > > > > > end assembler > > > > > > > > end if > > > > > > > > > Maybe you translate this in jal, as word is producing too > > > long > > > > > code... > > > > > > > > > Vasile > > > > > > > > > On Mon, Dec 13, 2010 at 1:57 PM, funlw65(Vasi) > > > > > > > > <[email protected]> > > > > > > > wrote: > > > > > > > > > Then, I believe you are right. I will see on Arduino > > > library > > > > > > how > > > > > they > > > > > > > > > do it... if there is not another source... > > > > > > > > > > Vasi. > > > > > > > > > > On Dec 13, 1:51 pm, vasile surducan > > > <[email protected]> > > > > > > wrote: > > > > > > > > > > OK, apai nu cred c-o sa mearga...because you didn't > > > computed > > > > > > > the > > > > > > > two's > > > > > > > > > > complement for negative temperature display. > > > > > > > > > > > Vasile > > > > > > > > > > > On Mon, Dec 13, 2010 at 1:46 PM, funlw65(Vasi) < > > > > > [email protected]> > > > > > > > > > wrote: > > > > > > > > > > > Hi Vasile, > > > > > > > > > > > > Not tested it yet but I will! do it tomorrow - > > > pentru ca > > > > > > > > azi > > > > > mai am > > > > > > > de > > > > > > > > > > > taiat niste lemne cu drujba :-D > > > > > > > > > > > > On Dec 13, 9:12 am, vasile surducan > > > <[email protected]> > > > > > wrote: > > > > > > > > > > > > Hi Vasi, > > > > > > > > > > > > > I'm just curious, this library works Ok with > > > negative > > > > > > > temperatures > > > > > > > > > too? > > > > > > > > > > > > > thx, > > > > > > > > > > > > Vasile > > > > > > > > > > > > > On Wed, Aug 18, 2010 at 2:42 PM, vasi vasi < > > > > > [email protected]> > > > > > > > > > wrote: > > > > > > > > > > > > > We don't have yet a 1wire library and I needed > > > it for > > > > > > > > > > a > > > > > DS18B20 > > > > > > > > > > > temperature > > > > > > > > > > > > > sensor. But I found one written by Vasile and > > > adapted > > > > > > > > > > by > > > > > Jean > > > > > > > > > > > Marchaudon, > > > > > > > > > > > > > included in Bert van Dam package. Is there a > > > reason > > > > > > > > > > why not > > > > > > > > > including > > > > > > > > > > > it in > > > > > > > > > > > > > Jallib? For a DS18B20 library, I did one (not > > > really > > > > > > > necessarily) > > > > > > > > > > > looking at > > > > > > > > > > > > > And-Tech.pl samples for their EvB 4.3 board and > > > at > > > > > > > > > > Bert > > > > > > > library, > > > > > > > > > > > > > ds1822_1_wire.jal. Now, I have working examples > > > [?] > > > > > > > > > > but > > > > > lots of > > > > > > > > > > > warnings. > > > > > > > > > > > > > Here is also a "disabled" sensor config.range > > > and > > > > > resolution > > > > > > > > > function , > > > > > > > > > > > not > > > > > > > > > > > > > tested - needs advices from experts. All > > > functions > > > > > > > > > > which > > > > > start > > > > > > > > > with > > > > > > ... > > > read more » -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
