pilotak / ds248x Goto Github PK
View Code? Open in Web Editor NEWA OneWire library using the DS2482 or DS2484 (1-Wire Master) for mbed.
License: MIT License
A OneWire library using the DS2482 or DS2484 (1-Wire Master) for mbed.
License: MIT License
The waitBusy() function seems to be generating quite a bit of delay, to the point where it takes about a minute to discover 6 DS18B20s on a bus. I added the following debug to the waitBusy() function:
while ((buf[0] & DS248X_STATUS_1WB) && ((poll_count++) < DS248X_POLL_LIMIT))
{
_timer = GetMicroseconds();
_i2c->read(_address, buf, 1, buf[0] & DS248X_STATUS_1WB);
_timer = GetMicroseconds() - _timer;
tr_debug("wait time: %dus", _timer);
}
and I get the following kind of output during a search:
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150400us
[DBG ][WIRE]: wait time: 86us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150381us
[DBG ][WIRE]: wait time: 109us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150403us
[DBG ][WIRE]: wait time: 86us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150381us
[DBG ][WIRE]: wait time: 112us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150403us
[DBG ][WIRE]: wait time: 112us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150380us
[DBG ][WIRE]: wait time: 108us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150404us
[DBG ][WIRE]: wait time: 109us
[DBG ][WIRE]: Sending[2]: 78:00
[DBG ][WIRE]: wait time: 150378us
[DBG ][WIRE]: wait time: 108us
It appears there are I2C reads taking over 150ms, which is quite long. I am running this on an STM32F103RB MCU. Why might this be taking so long?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.