|
Post by lglasmacher on Aug 1, 2019 13:09:07 GMT
Hello I have a problem with setting the register adress to read a sensor via I2C. Wire.beginTransmission(0x77); // Adress of the BMP 388 Pressure Sensor Wire.write(0x04); // Register Adress Wire.endTransmission(); Wire.requestFrom(0x77,3); // Read 3 Data bytes of the sensor The Hitex Shieldbuddy calls the sensor twice. After the first write call it repeats. ACK works. I read something of a Wire.requestFrom(the slave address, the number of consecutive registers to read, the first register to read, the length of the data (in bytes) and the stop signal at the end (if true)) But that seems not to work with the Wire.h Version in the Hitex Library. Thanks for any Help Bye Lukas
|
|
|
Post by deadman1966 on Oct 16, 2019 17:46:54 GMT
Hello I have a problem with setting the register adress to read a sensor via I2C. Wire.beginTransmission(0x77); // Adress of the BMP 388 Pressure Sensor Wire.write(0x04); // Register Adress Wire.endTransmission(); Wire.requestFrom(0x77,3); // Read 3 Data bytes of the sensor The Hitex Shieldbuddy calls the sensor twice. After the first write call it repeats. ACK works. I read something of a Wire.requestFrom(the slave address, the number of consecutive registers to read, the first register to read, the length of the data (in bytes) and the stop signal at the end (if true)) But that seems not to work with the Wire.h Version in the Hitex Library. Thanks for any Help Bye Lukas I am wondering if you got your sensor working i have a BMP180 and a DS3232 RTC on the bus and i am having issues with incorrect readings on the pressure sensor and the time on the RTC but the temp readings on the RTC are correct every time I too can confirm the double writes on the bus I have attached screenshots of my logic capture on the bus.
|
|
|
Post by Admin on Oct 16, 2019 18:10:20 GMT
The ShieldBuddy I2C driver has proved to be difficult to test. This makes use of the Infineon iLLD. Attached is the Wire.cpp driver source code. I suspect that the problem might be due to lines 194 & 195. Wire.cpp (8.28 KB)
|
|
|
Post by Admin on Oct 17, 2019 7:54:02 GMT
If all else fails, you could use the Software bit-bashed I2C driver that can use any two pins. See page 33 in the user manual. Here is an example that uses both the hardware and software I2C drivers. Wire1TestI2C.cpp (6.53 KB) Here is a DS1307 example that uses the software I2C. RTClib.cpp (14.52 KB) As the TC275 is so fast, the overhead of a bit-bashed I2C is very small.
|
|
|
Post by deadman1966 on Oct 18, 2019 8:08:50 GMT
If all else fails, you could use the Software bit-bashed I2C driver that can use any two pins. See page 33 in the user manual. Here is an example that uses both the hardware and software I2C drivers. Here is a DS1307 example that uses the software I2C. As the TC275 is so fast, the overhead of a bit-bashed I2C is very small. I did get the RTC working in one test program by adding this to the setup, in my case i am not on the default pins i have lowered the speed as i have the bus on my logic analyzer to see the signals. In one example i can read the rtc and use the Alarm triggered interrupts on the DS3232. I have not tested the sram yet. I am working on getting the DS3232 library example for setting the time on the chip via the serial terminal working.
Wire.setWirePins(UsePins_SDA1_SCL1); Wire.setWireBaudrate(10000); Wire.begin(); I find it interesting what is actually on the bus as it doubles the writes every time.
|
|
|
Post by Admin on Nov 2, 2019 16:41:20 GMT
We have made some changes to the I2C driver to eliminate the redundant writes. Thus will be released at the end of the coming week.
|
|