Using AT42QT2120 with a soft-I2C interface

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I've been trying out an AT42QT2120 as a "wheel" interface to replace a "knob". My demo code worked on a Mikroe development board, but doesn't work on my own board.

 

I've got some ideas to work through, but I'd like to know: does the "AT42QT2120" use "clock-stretching" to slow down the I2C interface, as one big difference between my successful test and the failure is the full test used hardware I2C, and the failed test uses a minimal soft I2C driver that doesn't support clock-stretch. The minimal driver was intended to support I/O expanders that never output on SCL.

 

I haven't seen it stated, but I get the impression the part may be a mask-programmed microcontroller, and therefore subject to bus timing limitations.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK so this turned into a bit of a saga as I tried porting my code to the Mikroelektronika board to test it, I seem to have wasted nearly a month on silly mistakes (wrong "ack" polarity and it took me way too long to spot that) but now I have the part working with my own driver code.

 

It seems to need to be CONSIDERABLY SLOWED DOWN compared to the I/O expanders, DAC and EEPROM.

 

To make it work the 1/4 bit delay I'm using is currently 10us, meaning the bus speed is probably nearer 25kHz.

 

Also it doesn't seem to communicate without clock-stretch.

 

Incidentally I haven't been able to put a 'scope on it yet.

 

Clarification: the device is working at full speed, possibly even 400kHz (unconfirmed) but it produces a long clock stretch on the "Ack" bit and the one following.

 

Last Edited: Mon. May 10, 2021 - 06:15 PM