D4D library troubles using a touch-screen LCD / MK53DN512CMD10 microcontroller

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

D4D library troubles using a touch-screen LCD / MK53DN512CMD10 microcontroller

2,251 Views
joséflores
Contributor II

Good afternoon:

I’m triying to use the D4D library on a custom pcb using the MK53DN512CMD10 microcontroller but I have some troubles. At the beginning I used the TWRK53N512 and I didn’t have troubles starting the LCD (NHD-1.8-128160EF).   The custom pcb is connected as shown on the table.

TOUCH-SCREEN

MICROCONTROLLER PIN NAME

CS

PTC9

RST

PTC10

D/C

PTC11

WR

PTC12

RD

PTC13

DB0

PTC0

DB1

PTC1

DB2

PTC2

DB3

PTC3

DB4

PTC4

DB5

PTC5

DB6

PTC6

DB7

PTC7

Y+

ADC1_DM1/

OP1_DM0

Y-

PGA1_DP/

ADC1_DP0/

ADC0_DP3

X+

PGA1_DM/

ADC1_DM0/

ADC0_DM3

X-

ADC1_SE16/

OP1_OUT/

CMP2_IN2/

ADC0_SE22/

OP0_DP2/

OP1_DP2

LED-A

DAC0_OUT/

CMP1_IN3/

ADC0_SE23/

OP0_DP4/

OP1_DP4

I already changed this pin configurations on the d4dlcdhw_gpio8080_8b_cfg.h file as follow:

* Signals definition

*******************************************/

  #define D4DLCD_CS              9         // CS

  #define D4DLCD_DC              11         // DC   

  // I/O port CONFIG for parallel transfer

  #define D4DLCD_WR              12         // WRITECLOCK       

  #define D4DLCD_RD              13         // READCLOCK

  /*********** Power macros - for modification uncoment and modify ***********/

  // Define void macros, because

      #define D4DLCD_INIT_CS                  SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;\

                                                                   CONFIG_PIN_FUNCTION(C,9,1);\

                                                                    OUTPUT(C,9)

       #define D4DLCD_ASSERT_CS          WRITE_PIN(C,9,0);

       #define D4DLCD_DEASSERT_CS     WRITE_PIN(C,9,1);

  // Define void macros, because

       #define D4DLCD_INIT_DC                  SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;\

                                                                     CONFIG_PIN_FUNCTION(C,11,1);\

                                                                     OUTPUT(C,11)

       #define D4DLCD_ASSERT_DC           WRITE_PIN(C,11,1);

       #define D4DLCD_DEASSERT_DC      WRITE_PIN(C,11,0);

  // Define void macros, because

       #define D4DLCD_INIT_RD                  SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;\

                                                                     CONFIG_PIN_FUNCTION(C,13,1);\

                                                                     OUTPUT(C,13)

       #define D4DLCD_ASSERT_RD           WRITE_PIN(C,13,0);

       #define D4DLCD_DEASSERT_RD      WRITE_PIN(C,13,1);

  // Define void macros, because

       #define D4DLCD_INIT_WR                   SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;\

                                                                       CONFIG_PIN_FUNCTION(C,12,1);\

                                                                       OUTPUT(C,12)

       #define D4DLCD_ASSERT_WR           WRITE_PIN(C,12,0);

       #define D4DLCD_DEASSERT_WR      WRITE_PIN(C,12,1);

  // Define void macros, because

       #define D4DLCD_INIT_DATA                SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;\

                                                                       CONFIG_PIN_FUNCTION(C,0,1);\

                                                                        OUTPUT(C,0);\

                                                     CONFIG_PIN_FUNCTION(C,1,1);\

                                                                       OUTPUT(C,1);\

                                                                       CONFIG_PIN_FUNCTION(C,2,1);\

                                                                       OUTPUT(C,2);\

                                                                       CONFIG_PIN_FUNCTION(C,3,1);\

                                                                        OUTPUT(C,3);\

                                                                       CONFIG_PIN_FUNCTION(C,4,1);\

                                                                        OUTPUT(C,4);\

                                                                        CONFIG_PIN_FUNCTION(C,5,1);\

                                                                        OUTPUT(C,5);\

                                                                       CONFIG_PIN_FUNCTION(C,6,1);\

                                                                        OUTPUT(C,6);\

                                                                       CONFIG_PIN_FUNCTION(C,7,1);\

                                                                        OUTPUT(C,7);\

                                                                        OUTPUT_ALL(C)

#endif /* __D4DLCDHW_GPIO8080_8B_CFG_H */

And with this configuration doesn’t appear anything on the LCD. I verified every signal, and I noticed that on pin 6(D/C-Data/Command selection) the signal is like this

TEK0029.JPG

And the signal of the tower, where the code works, is like this

TEK0027.JPG

I think the signal in this pin is the problem, cause the other signals are the same in both boards.

Did I miss change something in the code? What could be a solution for this trouble?

I will apreciate a lot your help !!!!!

Best Regards

Tags (2)
0 Kudos
Reply
3 Replies

812 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

If the problem is the polarity of DC signal, you should change:

#define D4DLCD_ASSERT_DC WRITE_PIN(C,11,0);

#define D4DLCD_DEASSERT_DC WRITE_PIN(C,11,1);

Luis

0 Kudos
Reply

812 Views
joséflores
Contributor II

Hi Luis,

Thanks for your answer. I changed the configuration as you told me, but unfortunately I still have the problem. Do you have any other idea to try to solve this problem?

Best regards.

José

0 Kudos
Reply

812 Views
EarlOrlando
Senior Contributor II

Hello José,

If the configuration is the same in both projects I think that there is a hardware problem, could you please share your schematic?

Best regards,

Earl.

0 Kudos
Reply