Hi all, running 2.6p4 on a FC5 I get some wrong readings from a DS2760 (like -31 C as room temperature...)
Bug 1 After some debugging I found that OW_r_int(...) (line 886 in ow_2760.c) is returning the temperature bytes from DS2760 in reversed order. OW_r_int has another way of reading the bytes (line 1043 in ow_2760.c) but this is commented out. Swapping comment of line 1043 and 1044 in ow_2760.c gives the right temperature reading, but I can't figure out if this is the right way to do it or if there is a general bug in UT_int16() (or maybe OW_r_sram()). Bug 2 But still I get the wrong thermocouple temperature. After some more debugging I realized that an old bug has been reintroduced (see e-mail from 5/23/06): FS_r_vis() has a special if-statement for DS2740BU (line 617,618 in ow_2760.c) which is only relevant for DS2740BU (or am I wrong?). After moving it to the case-statement of DS2740 (as it was in version 2.3p7) I got the right readings from the thermocouple. Does anybody know why this if-statement has been moved?? A diff of my changes is included below. Jan B. [EMAIL PROTECTED] c]$ diff ow_2760.c ow_2760.c_org 603,604d602 < if (pn->ft->data.v) < f = pn->ft->data.f; // for DS2740BU 618a617,618 > if (pn->ft->data.v) > f = pn->ft->data.f; // for DS2740BU 1043,1044c1043,1044 < I[0] = (((int)((int8_t)i[0])<<8) + ((uint8_t)i[1]) ) ; < //I[0] = UT_int16(i); --- > //I[0] = (((int)((int8_t)i[0])<<8) + ((uint8_t)i[1]) ) ; > I[0] = UT_int16(i); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Owfs-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/owfs-developers
