1
Character LCDs / NHD-C0216CZ-NSW-BBW-3V3 LCD initialization
« on: April 18, 2015, 05:09:52 PM »
Hello All,
1. I am having trouble initializing my NHD-C0216CZ-NSW-BBW-3V3 LCD using an STM32f303 discovery board. I am using the logic analyzer to debug my SPI communication protocol and the data I'm sending seems to be fine. I'm using the following SPI clock settings to send data; CPOL=1, CPHA=1.
2. I've done the following hardware connections: Between C1+ to C1- a 2.2uF cap, Vout to 1uF to GND; rest of the LCD pins to the microcontroller pins.
3. I've used the following initialization routine. The timing between the instructions sent is correct when I checked with my logic analyzer:
void lcd_initialization(void)
{
SS=1;
MOSI=1;
SCK=1;
RS=1;
RST=1
Delay(2);
RST=0
Delay(20);
send_inst(0x30); // wake up
Delay(2);
send_inst(0x30); // wake up
send_inst(0x30); // wake up
send_inst(0x39);
send_inst(0x14); // wake up
send_inst(0x56); // function set and instruction table = 1
send_inst(0x6D); // interanl oscillator frequency
send_inst(0x70); // power control
send_inst(0x0C); // follower control
send_inst(0x06); // contrast set
send_inst(0x01);
Delay(2);
}
4. I also used the following initialization routine:
void lcd_initialization(void)
{
SS=1;
MOSI=1;
SCK=1;
RS=1;
RST=1
Delay(2);
RST=0
Delay(40);
send_inst(0x38); // wake up
send_inst(0x39); // wake up
send_inst(0x14); // wake up
send_inst(0x78); // function set and instruction table = 1
send_inst(0x5E); // interanl oscillator frequency
send_inst(0x6A); // power control
delay (200);
send_inst(0x0C); // follower control
send_inst(0x01); // contrast set
delay (2);
send_inst(0x06); // entry mode set
}
Also, how do I check for the LCD busy flag when I only have a MOSI pin for the LCD but not a MISO pin??
I'm clueless on how to proceed further and the LCD shows no signs of life whatsoever except for the backlight. Any help would be really appreciated.
Thanks,
Krishna
1. I am having trouble initializing my NHD-C0216CZ-NSW-BBW-3V3 LCD using an STM32f303 discovery board. I am using the logic analyzer to debug my SPI communication protocol and the data I'm sending seems to be fine. I'm using the following SPI clock settings to send data; CPOL=1, CPHA=1.
2. I've done the following hardware connections: Between C1+ to C1- a 2.2uF cap, Vout to 1uF to GND; rest of the LCD pins to the microcontroller pins.
3. I've used the following initialization routine. The timing between the instructions sent is correct when I checked with my logic analyzer:
void lcd_initialization(void)
{
SS=1;
MOSI=1;
SCK=1;
RS=1;
RST=1
Delay(2);
RST=0
Delay(20);
send_inst(0x30); // wake up
Delay(2);
send_inst(0x30); // wake up
send_inst(0x30); // wake up
send_inst(0x39);
send_inst(0x14); // wake up
send_inst(0x56); // function set and instruction table = 1
send_inst(0x6D); // interanl oscillator frequency
send_inst(0x70); // power control
send_inst(0x0C); // follower control
send_inst(0x06); // contrast set
send_inst(0x01);
Delay(2);
}
4. I also used the following initialization routine:
void lcd_initialization(void)
{
SS=1;
MOSI=1;
SCK=1;
RS=1;
RST=1
Delay(2);
RST=0
Delay(40);
send_inst(0x38); // wake up
send_inst(0x39); // wake up
send_inst(0x14); // wake up
send_inst(0x78); // function set and instruction table = 1
send_inst(0x5E); // interanl oscillator frequency
send_inst(0x6A); // power control
delay (200);
send_inst(0x0C); // follower control
send_inst(0x01); // contrast set
delay (2);
send_inst(0x06); // entry mode set
}
Also, how do I check for the LCD busy flag when I only have a MOSI pin for the LCD but not a MISO pin??
I'm clueless on how to proceed further and the LCD shows no signs of life whatsoever except for the backlight. Any help would be really appreciated.
Thanks,
Krishna