8 years, 5 months ago.

LCD( TM162A) on Arm LPC1768

how to use LCD TM162A( 16x2)?? is it same function with HD44780. i already try using this

  1. include "mbed.h"
  2. include "TextLCD.h"

TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD20x4); rs, e, d4-d7

int main() { lcd.printf("Hello World!\n"); } but its not show anything word on LCD . i hope anyone can help me TQ

1 Answer

8 years, 5 months ago.

HD44780 by Hitachi was the first popular LCD controller and then came many compatible / clones of this IC. Your Tianma TM162A is based on the KS0032 which is most likely a clone. Your pinout looks the same as the example but you are defining the s/w to treat the display as a 20x4. Try with the following:

#include "mbed.h"
#include "TextLCD.h" 

TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD16x2); rs, e, d4-d7

Setting the type field in the TextLCD constructor allows configuration for the different display panel sizes:

TextLCD::LCD16x2     16x2 LCD panel (default) 
TextLCD::LCD16x2B    16x2 LCD panel alternate addressing 
TextLCD::LCD20x2     20x2 LCD panel 
TextLCD::LCD20x4     20x4 LCD panel 

Note: There is now also support for

TextLCD::LCD8x1    8x1 LCD panel
TextLCD::LCD8x2    8x2 LCD panel
TextLCD::LCD16x1  16x1 LCD panel
TextLCD::LCD16x4  16x4 LCD panel
TextLCD::LCD24x2  24x2 LCD panel
TextLCD::LCD24x4  24x4 LCD panel (for KS0078 controller)
TextLCD::LCD40x2  40x2 LCD panel
TextLCD::LCD40x4  40x4 LCD panel (two controllers)

In the future, please use <<code>> your code <</code>> markers for your code posting for best formatting.

Accepted Answer

TQ sir for helping me,this is really help me. and sorry for my question its look so messy

posted by Muhd Alif Abdullah 21 Apr 2017