I don't know if what you are working with uses hardware
or software (since I've only used T1) -- if you have started
with Moteworks you probably have T1...
Look at the low level driver and see. If it uses ATmega
hardware I would hope that it supports the "so called clock
synchronization mechanism".
Otherwise I put this in I2CM.nc to stretch the period
between bytes received a bit:
void i2c_ack()
{
MAKE_DATA_OUTPUT();
CLEAR_DATA();
pulse_clock();
SET_DATA(); // schip 8/12/09
TOSH_uwait(10); // -- to fix SC18 wait-state non-detect
}
MS
Sebastian Dölker wrote:
>
>
>
>
> Thank you for your quick reply!
>
>
>
> Yes I see my workaround isn’t such a good idea.
>
> With other I2C-Sensors (tsl2561 light sensor) I also hadn’t any problems
> and all worked fine. But with the k30 co2 sensor in particular something
> doesn’t work.
>
> I also tried to slow down the i2c clock but it didn’t help.
>
>
>
> The co2 sensor uses the so called clock synchronization mechanism.
> Is it what you mean Michael?
>
>
>
> This is described as follows in the I2C- Specification:
>
> “On the bit level, a device such as a microcontroller with or
>
> without limited hardware for the I2C-bus, can slow down
>
> the bus clock by extending each clock LOW period. The
>
> speed of any master is thereby adapted to the internal
>
> operating rate of this device.”
>
>
>
> Equally it is described in the atmel datasheet:
>
> “The slave can extend the SCL low period by
>
> pulling the SCL line low. This is useful if the clock
> speed set up by the master is too fast for the
>
> slave, or the slave needs extra time for processing
> between the data transmissions”
>
>
>
> Because of that I concluded that the Atml128-I2C components support this
> mechanism
> but now I’m not sure if it works fine.
> Have anybody successfully communicated with an i2c sensor
> that slows down the master clock with this mechanism?
>
>
>
> @michael
>
> Yes I think it is a related problem.
> If I don’t get it to work with the standard tinyos components I think
> bit banging will be the next step.
> Are there any sources? Can you give a hint?
>
>
> Best regards
> Sebastian
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help