Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: garbage98 on February 20, 2019, 03:50:05 AM

Title: Double Hight Font on a 763-NHD-0420CW-AW3 with Phyton on a Pi3b
Post by: garbage98 on February 20, 2019, 03:50:05 AM
Hi,

I purchased a 763-NHD-0420CW-AW3 OLED character display and would like to use the two upper lines as one text line with double size letters. Is this display capable of showing double height fonts?

I am using a Raspberry Pi 3b and I am developing in Phyton. Does someone know a good resource for a existing library to get things working quickly?

Thanks!
Title: Re: Double Hight Font on a 763-NHD-0420CW-AW3 with Phyton on a Pi3b
Post by: Ted_M on February 20, 2019, 09:43:43 AM
The NHD-0420CW-AW3 OLED display has the US2066 controller/driver built in which does support Double-Height font characters.
The command table in the display's datasheet includes the instruction code on pg.8.

Please also refer to page 37 of the US2066 datasheet for more details. http://www.newhavendisplay.com/app_notes/US2066.pdf (http://www.newhavendisplay.com/app_notes/US2066.pdf)

See our Github for a US2066 library. https://github.com/NewhavenDisplay/NHD_US2066 (https://github.com/NewhavenDisplay/NHD_US2066)

Another Github link with python code for this display that may be useful:  https://github.com/wjskrydl/nhd-oled (https://github.com/wjskrydl/nhd-oled)


Best Regards,
Title: Re: Double Hight Font on a 763-NHD-0420CW-AW3 with Phyton on a Pi3b
Post by: garbage98 on February 20, 2019, 11:31:49 AM
I will look into it. Thanks!
Title: Re: Double Hight Font on a 763-NHD-0420CW-AW3 with Phyton on a Pi3b
Post by: garbage98 on February 28, 2019, 05:24:01 AM
(https://i.imgur.com/20zQRNh.png)

I've found the command for controlling Line Size in the data sheet.
See datasheet pg. 8 https://www.mouser.de/datasheet/2/291/NHD-0420CW-AW3-1266321.pdf (https://www.mouser.de/datasheet/2/291/NHD-0420CW-AW3-1266321.pdf)

Can you help me figure out how to send this command to my display? I'm using the python module you've linked above.

Code: [Select]
def __command(self, byte):
        self.__bang(byte, True)

I'm unsure how to translate this command into byte format.

Thank you
Title: Re: Double Hight Font on a 763-NHD-0420CW-AW3 with Phyton on a Pi3b
Post by: Alee_S on March 01, 2019, 08:41:18 AM
Hi there,
 

The states of your D0-D7 bits will determine the hex value for your command.

Since the double height font feature is in the 'function set' command, you will need to send the 'function set' command. 
D0 can change the internal 'IS' bit to a 1 or 0, which can allow to use other commands listed in the datasheet. For now, I would advise to keep it low.
D1 will turn the internal 'RE' bit to 0.
D2 should be 1 to enable double height.
D3 should be 1, since you are operating with a 4-line display.
D4 can be either 1 or 0, indicated by the star.
We are also instructed to keep D5 as 1, and D6 and D7 as 0.

If we convert these 8 bits to hex value, we would get (0x2C) or (0x3C), depending on what your D4 value is.


Based off this, you may try and send either self.__command(0x2C) or self.__command(0x3C) at the end of your  def __begin(self): function.
 
Hopefully this will do the trick!