I'm designing a board in which an Attiny85 is connected to an accelerometer (MPU-6050) via I2C.
The I2C pins are in the ISP bus (SDA/MOSI, SCL/SCK). I wonder what happens to the accelerometer during programming of the MCU?
Are there any best practices I should follow? I considered just adding some solder jumpers, but I wonder if any precaution is even necessary.
Edit:
After finding out this is problematic, I'll try a solution based on Bruce Abbotts answer in another question.
1 Answer 1
The MPU-6050
may prevent you from programming the ATTiny successfully. It would interpret the ISP data as I2C and react accordingly. Expect interesting behaviuor on both SCL and SDA lines.
During programming the SCL and SDA should be disconnected from the Tiny MCU, e.g. by jumpers or dip switches.
-
\$\begingroup\$ Hmm, since during programming RST is pulled low, do you think it would be enough to just turn off the MPU? (i.e. with a couple FETs and RC filters to filter the pulse after chip erase) \$\endgroup\$Wesley Lee– Wesley Lee2016年09月16日 19:58:25 +00:00Commented Sep 16, 2016 at 19:58
-
\$\begingroup\$ RST is not wired up to the MPU in any way. And check the datasheet on the allowed voltages on SDA/SCL lines with respect to VCC in case you just wanted to cut the power. \$\endgroup\$Turbo J– Turbo J2016年09月16日 20:05:39 +00:00Commented Sep 16, 2016 at 20:05
-
\$\begingroup\$ I meant using RST to control FETs cutting power to the MPU. But thats another question altogether. I might just use a pin in the Tiny to do that instead. \$\endgroup\$Wesley Lee– Wesley Lee2016年09月16日 20:07:05 +00:00Commented Sep 16, 2016 at 20:07
-
\$\begingroup\$ Datasheet chapter 6.9 disallows that. Input voltages on SDA,SCL must not be bigger than VCC + 0.5 V. That includes the case when VCC= 0V aka powered off. In practise you will reverse power the chip, giving you even more interesting behaviour. \$\endgroup\$Turbo J– Turbo J2016年09月16日 20:12:30 +00:00Commented Sep 16, 2016 at 20:12
-
\$\begingroup\$ Thanks a lot for looking that up. I guess I'll have to find another method. \$\endgroup\$Wesley Lee– Wesley Lee2016年09月16日 20:16:00 +00:00Commented Sep 16, 2016 at 20:16