Electronic – How to shift cursor of a ST7032i based LCD

i2clcdmicrocontroller

I am using a MIDAS MCCOG21605B6W, I2C interfaced, COG type LCD.

I am also using a PIC16F616 microcontroller to interface it and I am bit-banging the I2C protocol.

I can initialize the LCD, write to the LCD, navigate the cursor to whatever position I like to, clear the LCD, set the contrast, power on/off the LCD, etc. Everything works, except for commands 0x10, 0x14, 0x18, 0x1C, which are for shifting the cursor or the display, left or right. How can I make them work? What I am I doing wrong?

I have noticed one thing; when looking from different angles, and when I give 0x14 command (shift cursor to right), or any other shift commands that I have mentioned in the above paragraph, I see some kind of contrast change, though it is not very apparent, you have to catch the angle.

I have also, for test purposes, sent only "Shift Cursor to Right" command, which is 0x14, then investigated it on the scope, and SDA, SCLK lines and data seems fine, it transfers, and the slave acknowledges.

I have created a dummy I2C tester code to show the traces for SDA and SCLK on the scope, as follows. You can see on the scope-shot that the LCD creates an ACK in the 9th clock pulse by pulling the line LOW.

software_I2C_startCondition();
software_I2C_sendByte(0x7C);
software_I2C_stopCondition();

Scope Shot

Below are my I2C routines and my LCD interfacing code.

software_I2C.h

software_I2C.c

main.c

Best Answer

Unless I missed this in your code you are still in "instruction table 1" mode, but the shift commands are only in instruction table 0. So instead of shifting the display/cursor, you alter the internal oscillator frequency. Sending another Ox38 at the end of your initialization routine might do the trick.

Related Topic