Use the resistive touch with the Segger Emwin and Psoc5LP.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi to all. I am new here. I hope someone can help me.

   

I am using a 3.2" (320x240) TFT with a resistive touch and I want to manage them using the Segger emWin library.

   

I have problems with the resistive  touch. I can´t get any touch feedback. I think that I am near to do it because I can see the square signal at the Xm+and Ym+ signals and also at the Xm- and Ym-  pins when I press the touch. But the emWin funtion GUI_TOUCH_GetState() doesn't give me the pressed state. I am using tha IL9341, although I know that is not supported by the library. I am using for testing.

   

I am upset because I have read that the emWin license has been frozen.

   

Regards Amaia

0 Likes
6 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I forgot to mention that for being able to see the square signals I had to configure the resistive touch component us Delta Sigma ADC. If I use the SAR ADC, that is supposed to be for the PSoc5, it didn't work.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi Amaia

   

I have attached for you a small project were I played with IL9341 Display and Resitive Touch.
Even though I have not used emWin you might be able to compare and check Resistive Touch

   

All the Best
Frank

0 Likes
Anonymous
Not applicable

Thank you very much Frank

   

Best Regards

   

Amaia

0 Likes
JiGi_284761
Level 4
Level 4
Welcome!

You can just set it up The Resistive touch component to run independently from Emwin by using a port interrupt that activates a function that is similar to a matrix keypad scan. It will first run function  \\ResistiveTouch_ActivateX()\\ then //ResistiveTouch_Measure()//   then \\ResistiveTouch_ActivateY()\\ then //ResistiveTouch_Measure()// to get your coordinates. Measure returns a ADC count on each measure that you need to convert to your pixel map .

   

I used to do it this way before I wrote my own code for it. It is not hard to do. Most HMI's these days use Bitmaped based widgets instead of drawn widgets so it is just a matter of selecting the stored bitmap and positioning it on the display and accessing it using callbacks (function pointers). Just use a good SRAM to store your bitmaps.

   

 

   

T

0 Likes
Anonymous
Not applicable

Thanks to all.

   

I already have it. The problem was that I did not initialize calibration values of the X and Y coordinates correctly.

   

The values of the constants:

   

#define TOUCH_AD_LEFT 500
#define TOUCH_AD_RIGHT 3030
#define TOUCH_AD_TOP 400
#define TOUCH_AD_BOTTOM 3700

   

Best Wishes

   

Amaia
 

0 Likes
Anonymous
Not applicable

hello frank sanderdo

   

can you send exact schematic about lcd? where can we buy it? i want to use color lcd in psoc but i am new about psoc

   

thanks

0 Likes