Comments (5)
Hi There,
I just happen to see this closed issue. Actually I have just encountered the exact same issue and I think I should put my solution here as a clue.
The main reason openCM9.04 and BNO055 cannot work together correctly is about the clock stretching. The BNO055 will pull down the SCL to low before and after the ACK signal for about 120 microseconds each. The hardware I2C of other devices can detect such a scenario and hold communication during that time. Yet the SlowSoftI2CMaster lib (which is used in the wire lib of openCM9.04) is lacking such ability, continuing sending the clock signal during that time which would not show up because of the SCL pulling low. And therefore the whole signal sequence afterward would be messed up because of such clock missing.
My simple solution is in SlowSoftI2CMaster.cpp, below L98, L104, L120, L126, adding the following code:
while(digitalRead(_scl)!=HIGH);
This line will do the job to detect the scenario I mentioned before and confirm the clock signal's integrity. You can change this code to some other detection methods with a timeout if there do have a possibility that something can pull the SCL to low for an unacceptable amount of time.
from opencm9.04.
Hi, @TahaShafa
I can not check the operation because I do not have that hardware.
Wire.h in OpenCM 9.04 uses software i2c, which can cause this problem because of the slow speed.
In the case of I2CDev, it is an API that is incompatible with the Wire example code. Unless you modify the code to match the I2CDev API, it will not be available.
from opencm9.04.
This issue will be closed since there were no actions for a while. You can reopen this issue to show this issue to the users whenever. Thanks.
from opencm9.04.
I was also trying to use OpenCM9.04 with Adafruit BNO055. The above solution does not work for me but it is really close. Instead, I only added the following line after line 103 and line 121(both lines are setHigh(_scl);
) in SlowSoftI2CMaster.cpp
located at Arduino15/packages/OpenCM904/hardware/OpenCM904/1.5.1/libraries/Wire
.
while(digitalRead(_scl)!=HIGH);
I also noticed that if I tried to pull the data from the sensor too fast(greater than about 300Hz), it will return zeros from time to time. As long as the polling rate is not too fast. It works pretty well.
After also adding one after line 85, the data didn't drop anymore.
from opencm9.04.
same issue~, with BNO055,hope the example code can add a i2c code .
from opencm9.04.
Related Issues (20)
- br410 uart over ble profile code HOT 2
- Are they a set? OpenCM9.04 Release 1.5.0 and OpenCM9.04 Firmware ver 23. HOT 2
- OpenCM 9.04 model for circuit design programs HOT 6
- Will Wire.h be implemented in hardware? HOT 3
- How to modifying the PWM frequency on the OpenCM9.04 ? HOT 2
- Cant't make OpenCM communicate with sensors via I2C HOT 2
- stdint.h not found error on compile for OpenCM
- ros2 micro-ros support
- Arduino IDE Board Manager cannot install OpenCM board HOT 2
- Arduino IDE - Uploading error: exit status 0xc0000135 HOT 2
- Support all of the Arduino installs - Now including ARM64 HOT 1
- Serial Port problems with <ros.h> on arduino IDE HOT 5
- Conflict with wire.h HOT 1
- Issues about sync read and its examples HOT 2
- Problem with example "n_Bulk_read_write" (groupBulkWrite addparam failed) HOT 7
- [OpenCM904 Not Detected UART Flash Loader] HOT 3
- [3.7.21][C++][USB2Dynamixel][XM540-W150-R] Issue: Writing and reading negative value of the current HOT 1
- Bootloader source HOT 1
- openCM904C Serial/UART Not working HOT 8
- Can't connect to MCU with ST-LINK/V2 and ST-LINK Utility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencm9.04.