Author Topic: NHD-0216AW-SB3 - issue with writing characters to screen  (Read 332 times)

kokomojoe

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
NHD-0216AW-SB3 - issue with writing characters to screen
« on: September 09, 2018, 07:29:49 PM »
Hello!
I am having issues with writing simple characters to the screen.  It appears that half of the character is written where it should be, then the other half is displayed half-way across the display.

My code is derived from the Arduino sketch.  My development environment is MCUExpresso 10.2, I am targeting a Kinetis KE06Z.  I am doing a simple bit bang serial interface. I've checked my output with a logic analyzer and compared it to the data sheet. So I'm confident I'm sending the right data in the order.  I used the initialization sequence from the Arduino sketch.  Things I've tried:
1. write a string character by character - same result
2. write a character then clear the screen. I single stepped through to see if complete letters would be displayed.  They were not. This still showed the problem of printing half on the left side and the other half 8 characters to the left. - same result
3. added 20 millisecond delay between character writes - same result.

I've googled other people's initialization sequence and the one I"m using is the same.  Although I'm sure it is a setting that is out of place.  Here is my init function:
Code: [Select]
void oled_init( void) {
#ifdef BIT_BANG_SPI
// configure the digital lines to use for SPI function

pinMode( SCLK, OUTPUT);
pinMode( SDIN, INPUT);
pinMode( SCLK, OUTPUT);
pinMode( SDOUT, OUTPUT);
pinMode( CS, OUTPUT);
pinMode( RES, OUTPUT);

digitalWrite( RES, LOW);
digitalWrite( RES, HIGH);

digitalWrite(SCLK, HIGH);
digitalWrite(SDOUT, HIGH);
digitalWrite(CS, HIGH);
 
oled_command(0x2A);  //function set (extended command set)
oled_command(0x71);  //function selection A, disable internal Vdd regualtor
oled_data(0x00);
oled_command(0x28);  //function set (fundamental command set)

oled_command(0x08);  //display off, cursor off, blink off
oled_command(0x2A);  //function set (extended oled_command set)
oled_command(0x79);  //OLED command set enabled

oled_command(0xD5);  //set display clock divide ratio/oscillator frequency
oled_command(0x70);  //set display clock divide ratio/oscillator frequency
oled_command(0x78);  //OLED command set disabled

oled_command(0x09);  //extended function set (4-lines)
oled_command(0x06);  //COM SEG direction

oled_command(0x72);  //function selection B, disable internal Vdd regualtor
oled_data(0x00);     //ROM CGRAM selection


oled_command(0x2A);  //function set (extended command set)
oled_command(0x79);  //OLED command set enabled

oled_command(0xDA);  //set SEG pins hardware configuration
oled_command(0x10);  //set SEG pins ... NOTE: When using NHD-0216AW-XB3 or NHD_0216MW_XB3 change to (0x00)

oled_command(0xDC);  //function selection C
oled_command(0x00);  //function selection C


oled_command(0x81);  //set contrast
oled_command(0x7F);  //set contrast control

oled_command(0xD9);  //set phase length
oled_command(0xF1);  //set phase length

oled_command(0xDB);  //set VCOMH deselect level
oled_command(0x40);  //set VCOMH deselect level

oled_command(0x78);  //OLED command set disabled
oled_command(0x28);  //function set (fundamental command set)
oled_command(0x2a); // added jch


oled_command(0x01);  //clear display
oled_command(0x80);  //set DDRAM address to 0x00
delay(3000);

oled_command(0x0C);  //display ON
delay(3000);
}

Thanks.

Joe

 

NHD‐2.4‐240320SF‐CTXL#‐FTN1 touch-screen problem

Started by hbcelebiBoard TFTs

Replies: 5
Views: 7959
Last post December 10, 2014, 11:19:05 AM
by Michael_L
Character LCD NHD‐0220D3Z‐NSW‐BBW‐V3 not receiving correct characters

Started by davekBoard Character LCDs

Replies: 1
Views: 4400
Last post March 25, 2016, 05:23:05 PM
by Saurabh_B
Shift position after "clear screen" instruction

Started by dreissBoard OLEDs

Replies: 5
Views: 5867
Last post September 18, 2015, 03:50:30 PM
by Saurabh_B
NHD‐240128WG‐BTFH‐VZ - custom characters

Started by saubaerBoard Graphic LCDs

Replies: 1
Views: 3376
Last post November 11, 2016, 12:09:42 PM
by Saurabh_B
3 Volt to 3.3 Volt longterm reliability issue

Started by muragavinoBoard OLEDs

Replies: 1
Views: 3418
Last post November 11, 2014, 03:04:04 PM
by Michael_L