I tried to grab doc.zip but got a "Error: blob is too big" error. Don't know if that's something at my end or Git's end.

Hi Graynomad, seems to be a problem with downloading of single large files on github's end. I tried it on my machine with the same results as you got. The work-around would be to download the whole master zip archive for Cosa and then unzip the documentation.

Oh, 50MB, maybe some other time, we don't all have unlimited data plans

I have no immediate use for this because I only (well mostly) work with 32-bit CPUs these days, however if you port this to the Due I'll get much keener as we're designing a new version of it and the fresh hardware platform may like a fresh software platform.

I was thinking of doing one myself but I've got my hands full designing hardware and will do for quite some time I think.

Oh, 50MB, maybe some other time, we don't all have unlimited data plans

I have no immediate use for this because I only (well mostly) work with 32-bit CPUs these days, however if you port this to the Due I'll get much keener as we're designing a new version of it and the fresh hardware platform may like a fresh software platform.

Thanks for the observation on the download size. I have cleaned this mess up and got the master zip from github down from 50 M to 343 K ;-).

The documentation and references have been moved to Dropbox. They shouldn't have been in the repository at github from the start. Sorry about that!

The callback, the virtual function on_low_voltage(), is called when the threshold is exceeded. The default implementation will print the measurement. Sub-class VCC and override the virtual function to implement your own action.

A new Cosa blog posting is now available. It presents some of the Cosa support for 1-Wire devices (with/without parasite powering), the DS18B20 driver, battery monitoring and sending sensor data using the Cosa Virtual Wire Interface (VWI).

More good work.I assume the 1-wire is handled with bit-banging the signal(s), any idea how much CPU time that takes?______Rob

Thanks!

Yes, the Cosa 1-Wire driver does bit-bang the protocol as most micro-controller implementations. I think Wiki explains the protocol very well http://en.wikipedia.org/wiki/1-Wire. There are all the numbers.

The reset or presence signal is the big waste in CPU-cycles if using a simple delay loop. Each bit in the protocol is short (shortest a 5 us pulse, 75 us per bit) so an alternative solution such as timer interrupt sampler is not really possible. UART would be possible.

Reading the temperature from DS18B20 is in the order of 2 ms (reset plus 1 byte command, 8 byte address, 1 byte command followed by read of 7 byte, 960 + 17*75 = 2235 us). Most of this time is delay loops. Typically interrupt handling is allowed between bit read/writes. The actual conversion takes 750 ms at full resolution. During this period the processor can do something else or take a nap.

To answer your question; typically less than 1% at 1 second sample rate (per device).

OK, thanks for that. I'm trying to decide if it's worth putting an I2C to 1-wire bridge chip on a new design, I think I will as that also gives active pullup.______Rob

I had a look at the DS2482-100 Single-Channel 1-Wire Master, I²C to 1-Wire Bridge Device. Interesting challenge to get the OWI device driver to run over the Cosa TWI, i.e. make the Cosa OWI driver hide the fact that a bridge was used and allow code written as an OWI::Driver to run unchanged.

Actually reading the sensor data from a DS18B20 will take a large number of TWI commands (1-Wire search is even worse). The sequencing is a challenge if to avoid polling the status register in a busy-loop over the TWI driver. This could actually increase the CPU load instead of decreasing it. Though there are a number of advantages with this chip I should add.