How to communicate with I2C devices with 2 addresses with the new I2C master driver
How to communicate with I2C devices with 2 addresses with the new I2C master driver
Please, can someone post an example code how for setup and communication with I2C devices which have 2 addresses (one for read and one for write) with the new I2C master driver?
-
MicroController
- Posts: 2694
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: How to communicate with I2C devices with 2 addresses with the new I2C master driver
Sounds odd. Are you sure that's two addresses and not a single address + R/W bit?I2C devices which have 2 addresses (one for read and one for write)
Do you have an example of such a device (datasheet)?
Re: How to communicate with I2C devices with 2 addresses with the new I2C master driver
From memory the VEML6040 does this. Very odd. Something like one address for register access and one address for data access. Totaly against the spirit of I2C. I'd recommend staying away from these devices.
Having said that, it's probably possible to add them as two separate slaves.
Having said that, it's probably possible to add them as two separate slaves.
Re: How to communicate with I2C devices with 2 addresses with the new I2C master driver
When I looked at the VEML6040 data sheet, it just indicates one slave address 0x10.
What data sheet are you looking at that indicates two different addresses?
What data sheet are you looking at that indicates two different addresses?
Re: How to communicate with I2C devices with 2 addresses with the new I2C master driver
Yes, I mixed up, sorry. The VEML6040 is okay, it's the VEML6070 that's troublesome.
BTW I have found another one: TSL2591. It listens to two addresses, which it responds to equally.
https://cdn-shop.adafruit.com/product-f ... ml6070.pdfSlave Address and Function Description
The VEML6070 has one slave address used for write functions (command) and two slave addresses used for read functions
(UV data LSB and MSB).
The 7-bit address for write functions is 38h = 0111000x resulting in a 70h = 01110000 8-bit address. The 7-bit addresses
for read functions are 38h = 0111000x for the UV Data LSB and 39h = 0111001x for the UV data MSB. This results in a
71h = 01110001 and 73h = 01110011 8-bit address, respectively. The 7-bit address 39h should not be used for a write function.
BTW I have found another one: TSL2591. It listens to two addresses, which it responds to equally.
Re: How to communicate with I2C devices with 2 addresses with the new I2C master driver
I think the idea of adding the same device as two different slaves may be the way to go, just treating the two different addresses as if they are for two different chips. That's what I would try anyway.
Who is online
Users browsing this forum: Google [Bot], PetalBot, Semrush [Bot] and 2 guests