Help with TTP22

Hi, Just wondering if anybody knows how to wire up and get going the Pro 16 channel Capacitive touch button switch module For Arduino TTP229.

Thanks

It's all spelled out in the datasheet:
http://www.go-gddq.com/down/2014-04/14040113211635.pdf

I'd use the I2C mode. Looks fairly straightforward. Send the address byte, read two data bytes.

Hi John..... it seems to be very simple seeing your comment. But the link gives the details on the IC TTP229 but not TTP229-B.... It would be really nice if you could share us the sketch ....... This would help us in getting the complete details like address.... etc....

Hello,

After a busy week-end, I was able to make mine work.
To cut it short, the TTP229B does not use I2C. It uses a very simple serial protocol (the 2 Wires serial protocol described in the 48 pins TTP229 datasheet).
The next problem is that, out of the box, the module is only capable of 8 keys, even with the serial protocol. You need to solder headers on P1 and P2 and strap the required options (see comments in the code).

Here is the clumsy code I used. Good luck :

//Test program for TTP229-B 16 capacitive keys module
//The module works with a basic serial interface :
//  The arduino sends a clock on the SCL pin and retrieves a bit from the SDO
//  pin for each clock step
//When delivered, the module is only capable of 8 keys, single touch, active low
//To access options, it is necessary to solder pins on the the P1 and P2 headers
// and use straps to enable the different functions
//P1 : 3 enables the 16 keys mode
//P1 : 2 enables active high mode
//P1 : 4 and P2 : 5 : multitouch mode : if both are strapped, full 16 keys 
//     multitouch is enabled
//The GetKeys function retrieves all 16 keys. 
//       Bit 15 is key 1 and bit 0 is key 15
//If the 8 keys mode is enabled, then the two bytes of the integer
//       have the same value
//The module has to be wired to the following Arduino pins :
// TTP  Arduino
// VCC  5V
// GND  GND
// SCL  D13 (or modify the CLOCK define)
// SDO  D12 (or modify the KEYS define)

#define KEYS 12 
#define CLOCK 13
unsigned int keys = 0;


void setup() {
  Serial.begin(9600);
  pinMode(KEYS, INPUT);
  pinMode(CLOCK, OUTPUT);
  delay(100);
}
unsigned int GetKeys()
{
  keys = 0;
  byte currbit = LOW;
  delay(3); //after 2ms without clock, the TTP229 resets, 
  //so, this ensures to get the 16 keys in the expected order

  for (byte i=0;i<16;i++)
  {
    digitalWrite(CLOCK,HIGH);
    delayMicroseconds(10);
    digitalWrite(CLOCK,LOW);
    delayMicroseconds(10);
    currbit = digitalRead(KEYS);
    if (currbit==HIGH) { //= If active High is set. Otherwise, invert the test
      keys=keys*2+1;
    } 
    else {
      keys=keys*2;
    }
  }
  return keys;
}

void loop() {

  Serial.println(GetKeys(), BIN);
  delay(100);

}