How do i change iic bus speed? setClock do not work for me!
Posted: Sun Jan 31, 2016 12:18 pm
Hi, my first post!
My name: Juan Ignacio Odriozola, from Uruguay, South America.
I'm a technician in electronics and a teacher. My native language is Spanish, so sorry for my bad English.
I bought some esp8266 sometime ago with the intention of using it with an arduino, never used them and recently i realized that they can be programmed, so last night i follow some tuts on how to setup the arduino ide and voila ... took me more time to get the module ready for use on a prototype board than the arduino ide to get ready.
this is my prototype (esp8266 spider project
Ok, i loaded an passed the blink test!
Then, I attach a 9DOF module with a digital compass (HMC5883) an accelerometer (ADXL345) and a gyroscope (ITG3200)
Do a loop for scanning slaves on the bus with success.
Then test the libs for each chip and find that some tweaking was needed, basically changing int by int16_t Init and reading of sensor ok. I send back via Serial.Print the readings and here is the graph using SerialGraph (nice app!):
I then connect a logic analyzer and saw the clock is about 100KHz (96 KHz), so i try Wire.setClock but no matter which number i pass to that method i get the same scl speed (ok i tested 100000, 400000 and 800000 only 3 numbers but final clock is the same)
I saw a thread about troubles with setClock but was finished as solved in the last release of the lib.
Any help is appreciated
Juan Ignacio Odriozola
My name: Juan Ignacio Odriozola, from Uruguay, South America.
I'm a technician in electronics and a teacher. My native language is Spanish, so sorry for my bad English.
I bought some esp8266 sometime ago with the intention of using it with an arduino, never used them and recently i realized that they can be programmed, so last night i follow some tuts on how to setup the arduino ide and voila ... took me more time to get the module ready for use on a prototype board than the arduino ide to get ready.
this is my prototype (esp8266 spider project
Ok, i loaded an passed the blink test!
Then, I attach a 9DOF module with a digital compass (HMC5883) an accelerometer (ADXL345) and a gyroscope (ITG3200)
Do a loop for scanning slaves on the bus with success.
Code: Select all
Wire.begin(SDApin, SCLpin);
Serial.println("");
Serial.println(" scanning slaves...");
for (int i=1; i<128; i++){
Wire.beginTransmission(i);
if (Wire.endTransmission(true)==0){
//ack!
Serial.print(i);
Serial.print(",");
}
}
Serial.println("");
Serial.println("end scanning");
Then test the libs for each chip and find that some tweaking was needed, basically changing int by int16_t Init and reading of sensor ok. I send back via Serial.Print the readings and here is the graph using SerialGraph (nice app!):
I then connect a logic analyzer and saw the clock is about 100KHz (96 KHz), so i try Wire.setClock but no matter which number i pass to that method i get the same scl speed (ok i tested 100000, 400000 and 800000 only 3 numbers but final clock is the same)
I saw a thread about troubles with setClock but was finished as solved in the last release of the lib.
Any help is appreciated
Juan Ignacio Odriozola