technoblogy / tiny-i2c

Minimal I2C master routines for all AVR microcontrollers.
161 stars 39 forks source link

Decluttering the signal #12

Closed oomek closed 2 years ago

oomek commented 4 years ago

Is it possible to tidy up the signal a little bit? I've been comapring the output of your lib with what the mcu of my TV is outputting and I've noticed some abnormalities: the unneccessary SDA spikes and the delay betwen the data and the ACK bit. Is it doable, or it's some hardware limitation?

image

technoblogy commented 4 years ago

The ATtiny85 doesn't have a dedicated I2C peripheral, and my routines use the general-purpose USI peripheral to emulate I2C. It's possible the emulation isn't perfect. Is this causing you a problem? You could try adjusting the delays in the code; they are inserted by the macros DELAY_T2TWI and DELAY_T4TWI.

oomek commented 4 years ago

I was experimenting with delays few days ago, but it did not have any effect on those spikes except making them wider.

technoblogy commented 4 years ago

Are these problems stopping it working for you?