krzyk2 11 Posted February 4, 2012 Share Posted February 4, 2012 Hi, I bought a 16x2 LCD from ebay and wanted to use it in 4 bit mode, with no shift register (I'm waiting for them to come). Maybe it will be useful to someone. The LCD is LMB162ABC-1 which uses ST7066U but it should work on HD44780 drivers. There is a bug in ST7066U documentation regarding 4 bit operation that was very annoying (looked for it about 2 hours). When initializing the 4 bit mode, in documentation it says that DB7/6/5/4 should be set to 0011, but actually DB4 should be set to 0, so nibble should be 0010. The interface is quite simple, just three public functions demonstrated in main.c: lcd_init(); lcd_goto(0,4); lcd_show("Hello"); lcd_goto(1,9); lcd_show("world"); The connections to the uC: * RS - P1.0 * R/W - P2.0 * E - P1.1 * DB4 - P1.2 * DB5 - P1.3 * DB6 - P1.4 * DB7 - P1.5 I didn't use R/W, probably I should connect it to the GND, but maybe I should try to read the busy state instead of using delay functions it would be more robust. BTW. I didn't know that TP1 and TP3 can be used to get 5v from the USB, useful for 3.3v logic, 5v BL LCD lcd_4bit.zip larsie 1 Quote Link to post Share on other sites
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.