TWR-K60N512 and TWR-LCD RD pin connection

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

TWR-K60N512 and TWR-LCD RD pin connection

1,146 Views
rabbit
Contributor III

In the "TWRLCDSCH.pdf", the RD pin (connector J2-pin33) is connected 3V3 via R18 resistor. I believe this will stop the K60 MCU reading the LCD.

the WR pin (connector J2-pin34) is connected to K60 MCU  FB_WR, the MCU can write to the LCD.

My question is if I want to read and write the LCD,  the LCD RD pin (connector J2-pin33)  should connect to which pin of K60 MCU?

Regards

Sam

Labels (1)
5 Replies

655 Views
LuisCasado
NXP Employee
NXP Employee

Hi Sam,

With the TWR-K60 and TWR-LCD hardware you can actually write and read the LCD data. You don't need any modification in hardware to read the TWR-LCD content using FlexBus.


Best Regards,

Luis

0 Kudos
Reply

655 Views
friederschrempf
Contributor IV

Luis Casado schrieb:

With the TWR-K60 and TWR-LCD hardware you can actually write and read the LCD data. You don't need any modification in hardware to read the TWR-LCD content using FlexBus.

Is this also true for TWR-K70?

I tried to read the LCD content with the eGUI (D4D) function for FlexBus and MQX:

static unsigned short D4DLCDHW_ReadDataWord_Mqx(void)

{     

   return *((unsigned short*)BSP_EXTERNAL_LCD_BASE);

}

But this always returns zero, no matter what I have on the screen.

0 Kudos
Reply

655 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Check the wait states in the CS configuration for reading. The eGUI doesn't modify them, as eGUi is not reading the display at all.

Luis

655 Views
friederschrempf
Contributor IV

Thank you Luis for the hint! You led me on the right track!

With the help of AN4393, page 16 bottom I was able to modify the FlexBus configuration to read from TWR-LCD.

The FB_CLK is set to 40MHz in MQX, therefore I have 25ns for each cycle and at least 4 cycles are needed for each write/read cycle. According to the SSD1289 datasheet a write cycle needs at least 100ns, which is fine without wait state.

But the read cycle needs 1000ns. Therefore I added (1000ns - 4*25ns) / 25ns = 36 wait states.

In init_hw.c i modified the function _bsp_flexbus_lcd_setup:

fb_ptr->CS[0].CSCR =     FB_CSCR_BLS_MASK |

                                             FB_CSCR_AA_MASK  |

                                             FB_CSCR_WS(36)   |

                                             FB_CSCR_PS(2)    |

                                             FB_CSCR_BEM_MASK;

There also is an error in eGUI (v3 beta) read FlexBus MQX function:

static unsigned short D4DLCDHW_ReadDataWord_Mqx(void)

{      

   return *((unsigned short*)BSP_EXTERNAL_LCD_BASE;

}

should be:

static unsigned short D4DLCDHW_ReadDataWord_Mqx(void)

{      

   return *((unsigned short*)BSP_EXTERNAL_LCD_DC);

}


With these changes reading works fine and I can use the eGUI function D4D_PrintScreenToBMP to take screenshots from the LCD and write them to the attached USB device.






0 Kudos
Reply

655 Views
apanecatl
Senior Contributor II

Hi Sam, you refer to "read" the information being displayed in the screen or reading the touch screen data through the 4 wire interface?

0 Kudos
Reply