Touchscreen problem

Peterj
Posts: 2
Joined: Tue Feb 26, 2013 7:45 am
Location: Bergerac SW France

Touchscreen problem

Postby Peterj » Wed Feb 27, 2013 10:05 pm

Hi All.

I have a problem which has me beaten.
Using a STM32F4 discovery board and this TFT:- http://tinyurl.com/am2x5wk
and the latest ChibiOS/GFX files I have built the touchscreen calibrate utility with help
from this github repo etmatrix/ChibiOS-GFX-Example.

When the code runs everything seems normal Device type touch detected.
Next test hold finger on touchscreen and all it keeps repeating on the screen is 0:0
Then the next test to touch a number of points to calibrate after the second teach it reports
Error: Same Reading - Check Driver!

I am running this with a the FSMC driver.

And now I am stuck checked the touchscreen with another program outside of ChibiOS and
the touch screen works fine.

Can somebody give me some pointers to lookout for.

Regards Peter

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Touchscreen problem

Postby Tectu » Thu Feb 28, 2013 4:44 pm

Hello Peter and welcome to ChibiOS!

The "hold down" test is not supposed to output the coordinates of the point touched, as far as I remember. When your calibration does fail every time, it's most likely because your pixel tolerance is set to low. Please try to set the value of GINPUT_MOUSE_MAX_CALIBRATION_ERROR higher. Let's begin with 20.
If this still dosen't help, please try a pen.

Also, you mentioned that the hardware works without ChibiOS -> Are you sure that your SPI is set up correctly?


~ Tectu

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Touchscreen problem

Postby Tectu » Thu Feb 28, 2013 8:21 pm

Okay, I just found some time to take out my hardware and make a quick test. I have used the exactly same LCD module as you:

  • STM32F103RBT
  • SSD1289
  • ADS7843
  • ChibiOS/RT: 2.5.1
  • ChibiOS/GFX: latest master

Also the calibration stuff works like a charm. Please try to increase the GINPUT_MOUSE_MAX_CALIBRATION_ERROR in the ginput_lld_mouse_config.h file of the ADS7843 driver. If this doesn't help, make sure your SPI is set up correctly.



~ Tectu

Peterj
Posts: 2
Joined: Tue Feb 26, 2013 7:45 am
Location: Bergerac SW France

Re: Touchscreen problem

Postby Peterj » Fri Mar 01, 2013 2:21 pm

Hello Tectu.

Sorry for the late reply to your suggestions.

I think you are correct the SPI port is not being setup properly.

I am trying to use SPI3 on GPIOC

TP_CS_PORT GPIOC
TP_IRQ_PORT GPIOC

TP_IRQ_PIN 5
TP_CS_PIN 4

SCK 10
MISO 11
MOSI 12

I think I need to read some more documentation on creating a ginput_lld_mouse_board for my setup.
As I do not appear to be able to create one correctly.

Regards Peter

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Touchscreen problem

Postby Tectu » Fri Mar 01, 2013 3:50 pm

I suggest you to take this board file and fix it to your needs. It shows how to do the SPI stuff correctly.


~ Tectu


Return to “LCD Driver and Graphic Framework”

Who is online

Users browsing this forum: No registered users and 1 guest