Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - blowtorch

Pages: [1]
1
OLEDs / Re: NHD-0420CW-AB3 contrast (brightness)
« on: August 14, 2015, 01:00:16 AM »
OK thanks.  I was hoping I could do a one off mod, the datasheet for US2066 refers to Iref on page 15 being set by resistor and I seg being a multiple thereof.

2
OLEDs / NHD-0420CW-AB3 contrast (brightness)
« on: August 12, 2015, 02:39:44 AM »
Hi

To test various algorithms for a forthcoming product, I have the abovementioned OLED display built into a test rig, standing on my bedside table every night.  To cater for night-time use in a dark room, and daytime use in the sun, we implemented a menu driven contrast adjust setting, over the full range allowed.

Problem is, is that even on lowest setting the screen is too bright and obtrusive at night in a dark room.  How can one gain more control over the level of drive to the OLED to reduce the OLED output? Can it be done in software or hardware?

3
OLEDs / Re: NHD-0420CW-AB3 init / cgram
« on: August 06, 2015, 04:26:10 AM »
Hi Sauraub

OK fixed, thank you.  If you look at the op you can see I was asking about that.  When reading the datasheet I missed the data bit that needs to be set for "data" mode, but picked it up in the example init routine.  I did not realise that one must first send the command byte, then command value, then data byte and finally data value.

Funny enough I did try that as well previously, with no success, but probably need a POR between that I missed or something. 

Thanks again.

4
OLEDs / Re: NHD-0420CW-AB3 init / cgram
« on: August 05, 2015, 06:55:28 AM »
Sure - its pretty standard stuff as per datasheet:

Init procedure:
Code: [Select]
uint8 LCD_US2066_Init() { // ok
uint8 ack;
I2C_Start();
ack=I2C_Write(LCD_US2066_ADDR);
if (ack!=0) return(ack);
ack=I2C_Write(0x2A); //function set (extended command set)
ack=I2C_Write(0x71); //function selection A
ack=I2C_Write(0x00);  // **** disable internal VDD regulator
ack=I2C_Write(0x28); //function set (fundamental command set)
ack=I2C_Write(0x08); //display off, cursor off, blink off
ack=I2C_Write(0x2A); //function set (extended command set)
ack=I2C_Write(0x79); //OLED command set enabled
ack=I2C_Write(0xD5); //set display clock divide ratio/osc freq
ack=I2C_Write(0x70); //set display clock divide ratio/osc freq
ack=I2C_Write(0x78); //OLED command set disabled
ack=I2C_Write(0x09); //extended function set (4-lines)
ack=I2C_Write(0x06); //COM SEG direction
ack=I2C_Write(0x72); //function selection B. Choose ROM set & CGRAM
ack=I2C_Write(0x00); //Select CGRAM & character ROM 0
ack=I2C_Write(0x2A); //function set (extended command set)
ack=I2C_Write(0x79); //OLED command set enabled
ack=I2C_Write(0xDA); //set SEG pins hardware configuration
ack=I2C_Write(0x10); //set SEG pins hardware configuration
ack=I2C_Write(0xDC); //function selection C
ack=I2C_Write(0x00); //function selection C
ack=I2C_Write(0x81); //set contrast control
ack=I2C_Write(0x02); //set contrast control 0x7F default
ack=I2C_Write(0xD9); //set phase length
ack=I2C_Write(0xF1); //set phase length
ack=I2C_Write(0xDB); //set VCOMH deselect level
ack=I2C_Write(0x40); //set VCOMH deselect level
ack=I2C_Write(0x78); //OLED command set disabled
ack=I2C_Write(0x28); //function set (fundamental command set)
ack=I2C_Write(0x01); //clear display
ack=I2C_Write(0x80); //set DDRAM address to 0x00
ack=I2C_Write(0x0C); //display ON
I2C_Stop();
delay_ms(100);  //delay
return 0;

}

As mentioned, standard other than adjusting contrast. I also have the other normal functions that allow one to set contrast, position clear screen etc. All works ok.
 
A small test program displaying the first 80 characters clearly shows ROMC is still selected, despite the sequence in the init routine to select ROMA.

5
OLEDs / Re: NHD-0420CW-AB3 init / cgram
« on: August 04, 2015, 06:07:09 AM »
Yes I have read the data sheet re 0x72 then 0x00. But my point re the code, is that by using the sample functions, the function named "data" actually sends ox40 then 0x00.  It works, because only the 4 LS bits need to be set to 0. But how would you then select ROM B?

Anyway that is not my problem, I am driving the OLED from a PIC with my own routines I have coded.

My problem, is that selecting ROM A does not work.  All the other routines work, but sending 0x72 followed by 0x00 is ignored. This I check by outputting the 1st 20 characters in CGROM, the characters displayed are from ROM C.

I suspect hardware fault on the boards, the datasheet for the controller says that one needs resistors to enable ROM selection.  Does Newhaven monitor this forum or should I make official contact with them?

6
OLEDs / Re: NHD-0420CW-AB3 init / cgram
« on: August 03, 2015, 12:40:09 AM »
Anyone?  I really need CGRAM to be working on this display.

Maybe I was not clear in first post above.  My main concern is that I cannot select the correct ROM and CGRAM which I need to be able to do.

The other secondary concern is more my understanding of the way the sample source code supplied works.   

7
OLEDs / NHD-0420CW-AB3 init / cgram
« on: July 28, 2015, 03:45:40 PM »
Hi, while trying to get cgram working I realise the display is always on ROMC. Whilst checking example init routine, I am also unsure of the 2 calls to the "data" function, as opposed to the "command" function.  My understanding of the data sheet would be to enter extended command mode, then send 0x71 for function selection A, then 0x00 to disable vregulator.  But all the example code would send the 0x71, then 0x40, then 0x00.

Ditto the initialisation code that does the ROM selection and cgram:  Example given:
    command(0x72); // function selection B
    data(0x00);  // by using the "data" function call, it actually sends 0x40 then 0x00

Seems like either I don't understand it or its a bug?   :)

On to the main problem:  I cannot get ROM A and cgram enabled.  Have tried sending 0x72 0x40 0x00  or 0x72 0x00 etc.

Any ideas?

Pages: [1]