I’m having trouble using peripherals on the seed’s I2C_2 bus. The I2C_1 bus is working just fine, and I’ve verified that the peripheral itself (VL53L0X distance sensor) and its hookups aren’t the problem. Here’s the code where I initialize the I2C config - I’ll pass either 1 or 2 into this function to choose the bus. When I use bus 2, I’m unable to communicate with the sensor.
Am I missing anything? Do I need to explicitly enable the second I2C bus? Are there any address-related differences? Would love to hear if anyone’s been successfully using both I2C busses.
Hi! The reason you can’t initialize I2C_2 is because that one’s already pre-allocated to the CODEC. Even though the MCU has 4 I2C peripherals, only two are exposed. Check this post for more info:
Hey, thanks for the reply - I did read through that post, wasn’t entirely clear on the solution. Are you saying I’d just need to change I2C_2 to I2C_4 in my above code for it to work? I could swear I tried that with no luck, but I can try again.
As far as I understand, yes. I2C_1 and I2C_4 are the two peripherals that are exposed on Daisy Seed. They also are both available on pins D11/D12 and D13/D14 if I understand correctly; i.e., you can initialize either peripheral on either sets of SCL/SDA pins. That said, I’m having some trouble myself getting IC_4 working, as explained in this post:
So, try it and see if you have better luck than I’m having.
Ok yeah, that matches my experience. I was initially trying I2C_4, but switched to trying 2 after I did some digging in the seed source files and found some clues that it might use 2 under the hood. Either way, tried lots of stuff and couldn’t get either one working.
Hi @comatose_llama! I’m really sorry for the delay in response.
We’ll have a closer look at this soon. It’s possible that I2C_4 doesn’t have DMA capabilities.
We’ll provide more details over here (Can't use I2C_4 on Seed) so that we can keep this topic in one location. Thanks!