There has obviously been some problem with the code since the bus-read/write operations in OW_w_mem() has been split up into multiple operations with lots of debug-output.
/* Re-read scratchpad and compare */ /* Note: location of data has now shifted down a byte for E/S register */ //ret = BUS_select(pn) || BUS_send_data( p,3,pn) || BUS_readin_data( &p[3],1+rest+2,pn) || CRC16(p,4+rest+2) || memcmp(&p[4], data, size) ; ret = BUS_select(pn); ret = BUS_send_data(p, 1, pn); ret = BUS_readin_data(&p[1], 3 + rest, pn); ret = CRC16(p, 4 + rest); // this fails according to your tests... ret = memcmp(&p[4], data, size); The read/write buffers and lengths are not the same in the first expression compared to the following rows... Perhaps it's just some typos when it was split down into multiple lines. I don't have any working DS1923 at home so I can't test the code. The CRC-check should be fixed and not removed to make sure we don't break any more DS1923 devices by sending them into a hanging state with the oscillator turned off. Paul, do you have any DS1923 devices at home? /Christian -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael D. Petersen Sent: den 29 juni 2008 06:06 To: owfs-developers@lists.sourceforge.net Subject: Re: [Owfs-developers] DS1923 Found the source of the problem, but I'm not sure why it is a problem. ow_1923.c (OW_w_mem): ret = CRC16(p, 4 + rest); if (ret) { printf("OW_w_mem: crc err1\n"); } The CRC16 fails, causing the read of temperature and humidity to fail. I was feeling brave, so I simply changed the CRC16 call to the following: ret = 0; That worked! Both temperature and humidity appear to read back with reasonable values. As a little background, this write routine is called as part of OW_oscillator to make sure the oscillator is enabled before a read operation (presumably to prevent the latchup condition in this part). Not sure why the CRC fails, but the write seems to work. Hopefully someone else can help explain that. Michael At 07:57 PM 6/28/2008, Michael D. Petersen wrote: >What is the latest level of support for the DS1923? The list of >devices (http://owfs.org/index.php?page=standard-devices) says there >is no support, but when I plugged one into the bus, it was >recognized. However, both the temperature and humidity files are >unreadable (yes, I did make sure the RTC was running). Just curious >if this is truly the current state of things. > >Thanks, >Michael > > >------------------------------------------------------------------------- >Check out the new SourceForge.net Marketplace. >It's the best place to buy or sell services for >just about anything Open Source. >http://sourceforge.net/services/buy/index.php >_______________________________________________ >Owfs-developers mailing list >Owfs-developers@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/owfs-developers ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers