Can't get CapTouchPaint to work

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Can't get CapTouchPaint to work

Post by flounder »

I got the Adafruit #1947 capacitive touch TFT shield. I have been working with it for the last couple hours getting a little game program (written by an 8-year-old, in JavaScript) to run on an Arduino (not a terribly complex transformation, but I had to keep in mind that he was going to have to maintain it, so the translation had to be pretty straightforward). OK, now let's try some touch in the game (the mouse control was going to go into the JavaScript version this coming week). So, I look around a bit, and find CapTouchPaint. Download all required libraries, compile, upload, and....nothing. Bring up the serial monitor. Nothing. Read the code. Oh, it is doing Serial.begin(115200). So I change it to Serial.begin(9600).

Upload again. Still nothing. Hit the Reset button. See the message
Cap Touch Paint!

There are only two possible outcomes to setup(), as shown below:
a. It can't start the controller, issues an error message, and hangs indefinitely in an infinite loop
b. It starts the controller and issues a success message

I was seeing neither message. As a precaution, I added a Serial.flush() before the infinite loop [surely there should be a more elegant way to handle failure in setup()] but again, saw no messages.

What now?
joe

Code: Select all

void setup(void) {
  while (!Serial);     // used for leonardo debugging
 
  Serial.begin(9600);
  Serial.println(F("Cap Touch Paint!"));
  
  tft.begin();

  if (! ctp.begin(40)) {  // pass in 'sensitivity' coefficient
    Serial.println("Couldn't start FT6206 touchscreen controller");
    Serial.flush();
    while (1);
  }

  Serial.println("Capacitive touchscreen started");
  

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Can't get CapTouchPaint to work

Post by adafruit_support_rick »

Curious. The only thing that could stop it like that is if the Wire library is hanging, trying to talk to the FT6206.
As a sanity check, I tried running CapTouchPaint on my resistive touch TFT. It comes back and says "Couldn't start FT6206". It doesn't hang.

We can try replacing the display. Can't think of anything else.

Please email [email protected] with a link to this thread for a replacement cap touch 2.8" TFT

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

Turns out this shield Does Not Play Well With Others. Sadly, the whole purpose of this is to work in a context where the motor shield (v2) is moving a set of sensors, and the display is supposed to display information derived from the sensor array in various positions. It seems I cannot both use the motor shield and the display shield.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Can't get CapTouchPaint to work

Post by adafruit_support_rick »

Are you sure it's a shield conflict and not just a memory issue? Offhand, I can't think of any reason why they would conflict with each other.

Can you post your entire sketch?

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

The only sketch that is running is CapTouchPaint. So there is nothing else to show.
joe

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Can't get CapTouchPaint to work

Post by adafruit_support_rick »

I mean the sketch that demonstrates the conflict with the motor shield. Are you saying that just installing the motor shield makes captouchpaint hang?

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: Can't get CapTouchPaint to work

Post by adafruit2 »

another thing to try, connect both together and run this, lemme know the output :)
basically, is there some i2c address collision

Code: Select all

/**
 * I2CScanner.pde -- I2C bus scanner for Arduino
 *
 * 2009, Tod E. Kurt, http://todbot.com/blog/
 *
 */

#include "Wire.h"
extern "C" { 
#include "utility/twi.h"  // from Wire library, so we can do bus scanning
}

byte start_address = 0;
byte end_address = 127;

// standard Arduino setup()
void setup()
{
    Wire.begin();

    while (!Serial);

    Serial.begin(9600);
    Serial.println("\nI2CScanner ready!");

    Serial.print("starting scanning of I2C bus from ");
    Serial.print(start_address,DEC);
    Serial.print(" to ");
    Serial.print(end_address,DEC);
    Serial.println("...");

    // start the scan, will call "scanFunc()" on result from each address
    //scanI2CBus( start_address, end_address, scanFunc );
    uint8_t data;
    for (uint8_t addr = start_address; addr<=end_address; addr++) {
      Serial.print("addr: 0x");
      Serial.print(addr,HEX);
      if (! twi_writeTo(addr, &data, 0, 1, 1)) {
        Serial.print(": found!");
      } else {
        Serial.print("\t");
      }
      Serial.print( (addr%4 == 3) ? "\n":"\t");
  
    }
    Serial.println("\ndone");
}

// standard Arduino loop()
void loop() 
{
    // Nothing to do here, so we'll just blink the built-in LED
    digitalWrite(13,HIGH);
    delay(300);
    digitalWrite(13,LOW);
    delay(300);
}

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

Well, it wasn't quite just the motor shield. Because I had mounted some components on the motor shield (which were not wired into anything, yet), I had to use a couple layers of stacking headers to get enough clearance to mount the shield. Then, to provide for some sensors, I put a blank prototyping shield in place. It was the v5 shield, and is missing some critical features the v6 board has, such as a through-ISP connector and eight pins instead of ten pins for one of the sockets (the v5 appears in https://learn.adafruit.com/adafruit-pro ... ld-arduino, and the v6 appears in https://www.adafruit.com/product/2077). The goal was to control the motor, read the sensors, and use the touchscreen to display information and provide some touch-control. One of the two pins is marked "IOREF" and the other one is unmarked. I don't know if the absence of these two pins is related to the problem, or the height of the stack is the cause (see photo), but when I plugged this stack into the Arduino UNO and plugged the touchscreen into the top of the stack, it didn't work. When I removed the stack, and plugged the touchscreen directly into the board, it worked.

See the attached photo; sorry about the pins blurring, but the autofocus latched onto the wires (which are in perfect focus); I decided that the pins aren't so blurry as to be confusing or misleading.

So I'm going to have to solder some stacking headers onto the R3, so I can plug this stuff into the bottom, so the stack will be display, Arduino, Proto-shield, and another motor shield with the rotary encoders soldered onto the bottom, as the last element in the stack. Fortunately, the cost of doing this is down at the "pocket change" level. I can spend more than this for a cheeseburger and milkshake. Or half a book. And I buy lots of books [my backlist is now measured in cubic yards].

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

Here's an interesting problem: I want to use the TFT Shield (#1943) plugged into my Arduino R3. Then, I want to use a standard breadboard (such as the prototyping system in the ARDX kit or what I can configure using the #275 and a half-size solderless board (#64)) to create my circuits. But if I plug the TFT shield into the Arduino R3, there's no way to plug anything else in! While I could use stacking headers, the problem is that I want to use that screen in a "product", and the stacking headers would have to be unsoldered so it would fit into the intended case. In fact, as far as I can tell, if I stack Arduino shields, unless the topmost one has stacking headers, I have no access to the signals.

There needs to be some kind of "T" connector. I have several ideas, such as a "breakout" board that has offsets of the general from o--o, where I can solder wires, or female headers, to one side and solder the pins of a standard or stacking header on the other side. This may be less than ideal, but surely the folks there at Adafruit can come up with a sensible solution to "break out" from a stack of shields using stacking headers with the topmost one not having stacking headers.

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Can't get CapTouchPaint to work

Post by Franklin97355 »

This might be an option https://www.adafruit.com/product/196

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

YES!!! What is BANNED annoying is that I actually have one, but never looked at it; didn't realize (or remember from the picture) that the screw terminals are OUTSIDE the stacking path!
joe

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

Well, not quite.

I located my windshield (#196) and assembled it. Then I plugged it into my Uno, and plugged the TFT shield (#1947) into it. Whoops! Everything works perfectly except the touch, which does nothing. So I unplug both, plug the TFTshield directly into the Uno. It works perfectly, and touches come through. So, I checked all the pairs of pins on the Wingshield to make sure I had not done a solder bridge . Every pair tests as open, except one, and I had a moment of panic until I remembered that GND is brought out on two pins. Yep, they should read "connected". So now I'm left with a problem where the TFT shield will not work when plugged into the Wingshield. Since all the connections are via the stacking headers, the only thing I'm left with is that the shield has more pins in places than the stacking headers that are on the Wingshield. So what pins are "missing"? Well, on the one side, I'm two pins short. One is the pin for "IOREF", and the last pin on that header on the Uno is unmarked. So I have no access to the "IOREF" and the unmarked pin. Well, maybe. On the other side, I'm also two pins short, but the last marked pin on the Uno is marked AREF, and that pin comes through. The two unmarked pins do not.

So what I'm left with is a missing connection to IOREF (the only marked pin) and two other unmarked pins. The documentation for IOREF says that a properly-configured shield can read this line and deal with issues such as 3.3V/5V level shifting. Since I am not at my home machine, I can't open up the schematics (I don't have EagleSoft on my iPad or Macbook Air), so I wonder if the absence of this signal matters. Currently, no data; the 1947 specs are silent about this (short of reading the Eaglesoft schematics).

Next, I plugged the Motor Shield V2 into the Uno. It has headers for all the pins. I plug the TFT into this. OK, touch comes through.

Sounds to me like the TFT shield is "properly designed' and uses the IOREF signal to configure its output. But in the absence of IOREF, it appears to fail.

This suggests that the WingShield design has a defect: passing one too few signals through.

Any suggestions? I really want this display at the top of my stack of shields (the motor shield V2 will be the other one for the next project, but after that...?). The whole point of this is that I can bring signals out from the stack and connect them to a prototyping board.

thank you
joe

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Can't get CapTouchPaint to work

Post by adafruit_support_rick »

Aha! The two pins next to AREF are SDA and SCL - the I2C pins. That's why your touch doesn't work.
BUT, you're in luck. There are a couple of solder pads on the back of the TFT labeled SDA and SCL. Solder those closed and you should be getting SDA and SCL through A4 and A5.

User avatar
flounder
 
Posts: 494
Joined: Wed Sep 18, 2013 9:10 pm

Re: Can't get CapTouchPaint to work

Post by flounder »

Hmmm. Will this require any change in the software that talks to it?

Then, of course, the inevitable question: if these are important pins, why doesn't the wingshield support them?
joe

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Can't get CapTouchPaint to work

Post by adafruit_support_rick »

No change to software. Just solder the jumpers.

Those two pins were added with the Uno R3. The wingshield design predates that.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”