I'm doing a circuit with an ATINY85 IC and an I2C sensor, and it'll be programmed by SPI. The SDA and SCL lines of the Attiny85 are the same as the MOSI and SCK pins needed for programming.
I've read a few posts on how to isolate the SDA and SLC lines when proogramming the Attiny85 (like this one: Isolate I2C sensor from Master while programming). Solution of the post below:
Would this option below be effective also? I though about the same idea of the previous post, but I disconnected the I2C sensor supply line (it runs at 5V), and left the SDA and SCL lines connected. The SDA and SCL are pulled high on the sensor, but there'll be not supply for these pins while programming.
EDIT: The SDA and SCL lines are also pulled high by a 10k resistor in my pcb also, so they would be pulled high all the time, even with the sensor VIN disconnected. Would it also affect programming the MCU by SPI?
When one Attiny GPIO is set to high, the sensor would be turned on. When programming, the GPIO is pulled low, and the sensor is disconnected.
Would this work also as a method to program the Attiny by ISP without conflicting with the I2C sensor (in my case a TOF sensor, VL6180X). Should I modify something? Or I must use the other post's solution?