[no longer relevant] Touch using CTE shield on DUE etc

Ok, now that I have got the 7" TFT working I'm trying to get the touch screen working....

I've installed Henning's Utouch library [Electronics - Henning Karlsen] and now I'm trying to see if I can get it to work.

Strangly when I run the Utouch demo the display reverses again! ie it works backwards from the UTFT demo but anyway I'll look at that later, for now I can reverse the screen at will so it's not an issue.

The Utouch demo starts off initialising the screen etc so I've copied those bits from UTFT and the display works complete with buttons.

The touch option does nothing, here is the init line for touch:

UTouch myTouch(6,5,4,3,2);

The parameters are:

TCLK, TCS, TDIN, TDOUT, IRQ

so

TCLK=6
TCS=5
TDIN=4
TDOUT=3
IRQ=2

Looking at the DUE pin out sheet and the CTE shield it would appear that it is connected like this for the 32 pin TFT:

TCLK = CLK on the ICSP header = Digital pin 76
TCS = 31 on the header which according to the shield circuit diagram should be = Digital pin 5
TDIN = miso on the ICSP header = Digital pin 74
TDOUT = mosi on the ICSP header = Digital pin 75
IRQ = 26 on the header which according to the shield circuit diagram should be = Digital pin 2

So this would make it:

UTouch myTouch(76,5,74,75,2);

Now I ran it for the first time and the calibration program changed screen when I pressed it first time so I thought it was all working but I couldn't calibrate the screen nor would it do anything else. After re-running the program over and over touch does not work at all. Not sure why the screen changed first time but it isn't working now.

I am going to carry on working on it (as I did with UTFT) but if anyone has any input or has already got this working it would be appreciated.

Also has anyone any idea if any libraries work with the SD card slot on the CTE board using a DUE or better still the micro SD card slot on the TFT.

Cheers.

Can't get the SD card to read either......

Re SD card there doesn't appear to be anywhere to change the SD SPI pin. On the CTE shield it states that this is 53 if jumper 8 is set but doesn't say what it is if it is not set. Again will look into this.

That link must be N/C if not made. I've just put an SD card into the card slot on the LCD and it reads it....

Just touch to get working now :smiley:

OK, got touch working now too :smiley:

UTouch myTouch(6,52,4,3,2);

Good Stuff!! I have the 7" working with the same shield too, but I haven't tried the touch stuff. I'll tackle that now. I'm looking forward to using this Shield with the 5" version of this TFT (same controller, same 800X480 res). It's that the 5" version is a bit more enclosure friendly than the 7".

Peter

Nope, it appears it should be:

UTouch myTouch(6,5,4,3,2); after all but.....

When you touch the screen data becomes available so "touch the screen to continue" works but......

It always returns 509,264 as x,y

Hi Cowasaki,

since there have been reports of problems regarding SD incompatibility with some shields, which SD card have you successfully used with the CTE shield?

Thanks,
dodgerts

It wasn't in the CTE shield it was in the back of the LCD. It was a 2Gb Sandisc micro SD.

I don't think that the CTE shield is quite right for the touch part of the wiring somehow..... It works for the TFT (so long as I use CTE's modified UTFT library) and the micro SD card works but their touch software is rubbish and doesn't work. If I use henning's software I just get a detection that the screen has been touched but it always returns the same values....

I am attempting to run this code. I want to load a small bitmap called sonora.bmp from the SDCard on the 7" screen and the ColdTears shield. But I get an error (it's below the code)

#include "SPI.h"
#include <UTFT.h>
#define FLASH_CS_PIN 52 
#define SPI_RATE 4
#define BVS_13 10
#define BVS_15 12
#define BVS_19 14
#define BVS_22 18
#define BVS_28 22
#define BVS_34 28
#define BVS_43 38
#define BVS_52 53
#define BVS_74 78
#define BVS_112 122

extern uint8_t BigFont[];

UTFT myGLCD(CTE70);

void setup()
{
  delay(1000);
  myGLCD.SPI_Flash_init(FLASH_CS_PIN,SPI_RATE);
  Serial1.begin(38400);
  myGLCD.InitLCD();
  myGLCD.setFont(BigFont);
}


void loop()
{
  myGLCD.clrScr();
  myGLCD.Swtich_LCD_TB_Bit(0);
  myGLCD.print("Sonora Technical",CENTER,75);
  myGLCD.drawRect(300,140,500,340);
  myGLCD.drawCircle(600,350,80);
  myGLCD.Load_image(0,0,"Sonora");
  while (true) {};   
}

C:\Projects\ArduinoProjects\Arduinos\arduino152/hardware/tools/g++arm_none_eabi/bin/arm-none-eabi-g++ -c -g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=152 -D__SAM3X8E_ -mthumb -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\system/libsam -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\system/CMSIS/CMSIS/Include/ -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\system/CMSIS/Device/ATMEL/ -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\cores\arduino -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\variants\arduino_due_x -IC:\Projects\ArduinoProjects\Arduinos\arduino152\hardware\arduino\sam\libraries\SPI -IC:\Projects\ArduinoProjects\Arduinos\arduino152\libraries\UTFT_DUE C:\Users\HERNAN~1\AppData\Local\Temp\build8677726899341832836.tmp\CTE_70inch_800x480CircRect.cpp -o C:\Users\HERNAN~1\AppData\Local\Temp\build8677726899341832836.tmp\CTE_70inch_800x480CircRect.cpp.o
CTE_70inch_800x480CircRect.ino: In function 'void loop()':
CTE_70inch_800x480CircRect:37: error: invalid conversion from 'const char*' to 'int'
CTE_70inch_800x480CircRect:37: error: initializing argument 3 of 'void UTFT::Load_image(int, int, int)'

DanyHdez:
I am attempting to run this code. I want to load a small bitmap called sonora.bmp from the SDCard on the 7" screen and the ColdTears shield. But I get an error (it's below the code)

The error is in the Load_Image function call. Have you checked what is required of this call? Also you might need to add .bmp - I've not used it myself.

Daniel,
Bear in mind load_image is not actually loading anything from the SD chip.... Rather it is loading it from the 1963 LCD Flash.... It is stored in the LCD Flash by location...(hence the requirement for the function call to be fed 3 integer values, x, y, location id).
There is another sample sketch that tells you how to load/import a file from the SD chip into the LCD Flash....
None of it is as pretty as we'd like...but it's there.

Here's the benefit... If you can Import all of the images into the LCD Flash...then you no longer need to 'mount your file system...aka SD card' in your sketches. Therefore, that spares you loading some headers and doing extra defines that you won't use. Downside is..if the LCD goes bad...you will have to reimport all of the fotos...in other words, run the import sketch again.

Looks like cold tears even offers a windows based utility as one of the steps in the process...
I'll go through the process myself...as I have the same equipment. ;p
Peter

Thanks! Yes I'm trying to run that scketch that tells me how to load an image into my LCD Flash memory but it's still doing nothing..

I followed step by step of Image Importer Guide proccess and still nothing...

:frowning: heh

hi cowasaki,

bear in mind that the tft you using is a 32 pin version, which means that the touch controller is direct connected to the spi bus and share with the sd card. if you look at the touch library, it is written for the 40pin version, of which the touch controller is not connected to the spi bus. thats why you cannot get the touch working.

cowasaki:
It wasn't in the CTE shield it was in the back of the LCD. It was a 2Gb Sandisc micro SD.

I don't think that the CTE shield is quite right for the touch part of the wiring somehow..... It works for the TFT (so long as I use CTE's modified UTFT library) and the micro SD card works but their touch software is rubbish and doesn't work. If I use henning's software I just get a detection that the screen has been touched but it always returns the same values....

coldtears:
hi cowasaki,

bear in mind that the tft you using is a 32 pin version, which means that the touch controller is direct connected to the spi bus and share with the sd card. if you look at the touch library, it is written for the 40pin version, of which the touch controller is not connected to the spi bus. thats why you cannot get the touch working.

cowasaki:
It wasn't in the CTE shield it was in the back of the LCD. It was a 2Gb Sandisc micro SD.

I don't think that the CTE shield is quite right for the touch part of the wiring somehow..... It works for the TFT (so long as I use CTE's modified UTFT library) and the micro SD card works but their touch software is rubbish and doesn't work. If I use henning's software I just get a detection that the screen has been touched but it always returns the same values....

The CTE shield has both a 32 and 40 pin connection, is there not a way to get the touch to work on the 32 pin connection ??

Ok, my CTE shield has arrived two days ago. While I have not connected a TFT yet, I want to let you know that the on board SD card works well (have not done intensive testing, like speed, etc).

It works with both, the official SD library included in the IDE 1.5.2, as well as with the SdFat (beta20130207).

Pin is 53.
JP8 needs to be connected.

, dodgerts

cowasaki:
It wasn't in the CTE shield it was in the back of the LCD. It was a 2Gb Sandisc micro SD.

Now if I could find how to make touch work with a 32pin tft that would be great

I just received my 5" 800X480 SSD1963 TFT from CT. It has a 40pin header.
I am using it on the 40 pin header of the CTE shield for DUE.
Going to try getting SDFat, Touch and all of the Demos working on it.

Peter

OK,
Found the source of my issues... I purchased the WRONG SSD1963 LCD panels.
Cold Tears Electronics offers the 5" & 7" SSD1963 800X480 LCDs in TWO versions... With Font IC and Without. Unfortunately, I have both of them without the IC, hence the demos show garbage for the text and bitmap portions. I've ordered the correct versions now...

However, with the CTE shield, I had great success with two others offered by Cold Tears Electronics:
3.5" 480X320 R61581 LCD Controller & ADS7843 compatible Touch Controller w/ Font IC
3.2" 320X240 SSD1298 LCD Controller & ADS7843 compatible Touch Controller w/ Font IC

We used their modified versions of the Utouch & UTFT libraries (which probably precludes adopting everyone's high speed modifications they are developing for Hennings Libraries).

I found performance acceptable. Touch Screen Worked. It's a little weird using a utility to load from the SDCard into the Built-In Flash...and then your code calls your images from the Flash by Number. That means you can't easily just stick new images on and SD Card and modify your sketch. Instead you have a finite number of images to work with. That's ok. My preference is the 480 as the visual quality is very good.

The other odd thing is for the 3.5" screen with a resolution of 480X320, the Touch Screen has a resolution of 509X264. For the 3.2" screen with a resolution of 320X240, the touch screen had the same resolution of 509X264. So in my code I will resolve the difference by scaling the data I receive from the touch controller to match my graphical coordinates:
Screen Res X = 480 - (Touch Res X * 0.9375)
Screen Res Y = (Touch Res Y * 1.2121)
Resolving it this way should help with deciding what object (slider, button, toggle) was manipulated by the user. Without re-inventing the wheel I'll need to see how some folks went about creating an object oriented approach.

Can you not just solder on a font IC?