Touch Screen TWR_LCD using MQX4.0 & k70

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Touch Screen TWR_LCD using MQX4.0 & k70

978 Views
ankurchauhan
Contributor I

Hi,

I'm using TWR_LCD with MQX 4.0 and K70 twr kit.

I'm able to use display LCD as output (i.e able to print character on screen) using D4D libraries.

But Touch screen is not working.

How to make is work PLZ suggest.

Regards

Ankur

0 Kudos
4 Replies

599 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the below thread and the following application note.

TWR-K70F120M + TWR-LCD-RGB using CodeWarrior + eGUI code example

http://cache.nxp.com/files/32bit/doc/app_note/AN4452.pdf

I hope this helps,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

599 Views
soledad
NXP Employee
NXP Employee

Hello Ankur,

Please check the below answer from the thread: Resistive touch twr-lcd using k70

I hope this helps, have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

You can also check the eGUI code. It includes drivers for resistive touch screen and ADC.

https://github.com/Gargy007/eGUI/tree/master/D4D/low_level_drivers/touch_screen

This is the configyration for TWR-K70 using the TWR-LCD touch screen. Notice, you need hardware rework to connect resistive touch in TWR-LCD to TWR-K70.

#define D4DTCH_ADC_HW D4DTCH_ADC_HW_KINETIS

  #define D4DTCH_ADC_ID 1 // Use ADC module 1

#define D4DTCH_MCU_USER_INIT {D4DTCH_X_PLUS_PCR = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;\

                             D4DTCH_X_MINUS_PCR = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;\

                             D4DTCH_Y_PLUS_PCR = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;\

                             D4DTCH_Y_MINUS_PCR = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;\

}

// X+ wire definition

  #define D4DTCH_X_PLUS  17

#define D4DTCH_X_PLUS_PORT GPIOA_PDOR // Data output register

#define D4DTCH_X_PLUS_DDR  GPIOA_PDDR // Output enable register

#define D4DTCH_X_PLUS_ADCH 17         // ADC channel number

#define D4DTCH_X_PLUS_PCR  PORTA_PCR17

  // X- wire definition

  #define D4DTCH_X_MINUS 10      

  #define D4DTCH_X_MINUS_PORT GPIOB_PDOR

  #define D4DTCH_X_MINUS_DDR  GPIOB_PDDR

#define D4DTCH_X_MINUS_PCR  PORTB_PCR10

    // Y+ wire definition

  #define D4DTCH_Y_PLUS  6    

  #define D4DTCH_Y_PLUS_PORT GPIOB_PDOR

  #define D4DTCH_Y_PLUS_DDR  GPIOB_PDDR

#define D4DTCH_Y_PLUS_ADCH  12

#define D4DTCH_Y_PLUS_PCR  PORTB_PCR6

//#define D4DTCH_INIT_Y_PLUS OUTPUT(D4DTCH_Y_PLUS); RESET(D4DTCH_Y_PLUS);

  //#define D4DTCH_RESET_Y_PLUS RESET(D4DTCH_Y_PLUS);

//#define D4DTCH_SET_Y_PLUS  SET(D4DTCH_Y_PLUS);

  // Y- wire definition

  #define D4DTCH_Y_MINUS 5

  #define D4DTCH_Y_MINUS_PORT GPIOB_PDOR

  #define D4DTCH_Y_MINUS_DDR  GPIOB_PDDR

#define D4DTCH_Y_MINUS_PCR  PORTB_PCR5

  //#define D4DTCH_CALIB_CROSS_OFFSET 30

// Constant specifying maximum ADC value for a screen touch (=12bits)

#define D4DTCH_FULL_SCALE          0x0FFF

// Constants specifying minimum ADC value for a screen touch

#define D4DTCH_X_TOUCH_MIN             (D4DTCH_FULL_SCALE / 10)

#define D4DTCH_Y_TOUCH_MIN             (D4DTCH_FULL_SCALE / 10)

#define D4DTCH_X_TOUCH_OFFMAX             (D4DTCH_X_TOUCH_MIN * 3)

#define D4DTCH_Y_TOUCH_OFFMAX             (D4DTCH_Y_TOUCH_MIN * 3)

// Constants specifying ADC difference for touch screen sample

//#define D4DTCH_SAMPLE_MARGIN           (D4DTCH_FULL_SCALE / 256)

0 Kudos

599 Views
ankurchauhan
Contributor I

Hi Soledad,

Thanks for reply.

#define D4D_LLD_TCH d4dtch_resistive_mqx

I'm using MQX with above configuration you advised changes are not possible.

Shd i change the configuration or some other option is there to enable the touch.

Regards

Ankur

0 Kudos

599 Views
ankurchauhan
Contributor I

What should be MQX settings(bsp or anywhere else) to enable touch screen using K70.

0 Kudos