Hi List,
I'm trying to write a script to automatically start Thermochron
missions. However, I cannot get the delayed start to work.
From looking at the source in ow_1921.c it appears that when the
mission is started (when writing to the frequency register), it first
clears all memory. This is a requirement, according to the datasheet, so
is correct. However it also clears the delay register. This happens in
function:
static GOOD_OR_BAD OW_startmission(UINT freq, struct parsedname *pn)
I'm not familiar enough with the inner workings of owfs, but one
potential solution could be to first read the delay register, then clear
memory and then restore the delay register, before finally writing the
frequency register. I've tested this and appears to work as intended.
Patch is attached (if that works, sending to the list).
There may be better solutions, of course.
Cheers
Arthur
*** ow_1921.c.orig 2010-09-24 14:10:31.000000000 +1200
--- ow_1921.c 2011-03-05 13:59:08.000000000 +1300
***************
*** 1155,1160 ****
--- 1155,1161 ----
static GOOD_OR_BAD OW_startmission(UINT freq, struct parsedname *pn)
{
BYTE data;
+ BYTE delay[2]; /* 20110304, A de Beun */
/* stop the mission */
RETURN_BAD_IF_BAD(OW_stopmission(pn)) ;
***************
*** 1175,1183 ****
--- 1176,1190 ----
UT_delay(1000); /* wait for the clock to count a second */
}
+ /* read delay register */
+ RETURN_BAD_IF_BAD(OW_small_read(&delay, 2, 0x0212, pn)) ; /* 20110304, A de Beun */
+
/* clear memory */
RETURN_BAD_IF_BAD( OW_clearmemory(pn)) ;
+ /* write delay register */
+ RETURN_BAD_IF_BAD(OW_w_mem(&delay, 2, 0x0212, pn)) ; /* 20110304, A de Beun */
+
/* finally, set the sample interval (to start the mission) */
data = BYTE_MASK(freq);
return OW_w_mem(&data, 1, 0x020D, pn);
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers