Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: jonmon6691 on May 03, 2016, 09:38:59 PM

Title: Problem setting "function select c" register
Post by: jonmon6691 on May 03, 2016, 09:38:59 PM
I have my NHD-0220CW-AR3 working fine, but I can't seem to get the "Function Select C" command to work. The datasheet says the POR value should be 0xDC02, I am pretty sure I have the SD bit set before I send the command too.

Here's a snippet:
Code: [Select]
set_sd(d);
command2(0x81, d->sd_reg_contrast); // This function works, can see the contrast change. so set_sd() and command2() must work...?
command2(0xD5, d->sd_reg_clock);
command2(0xD9, d->sd_reg_phase_length);
command2(0xDA, d->sd_reg_SEG_config);
command2(0xDB, d->sd_reg_Vcom_deselect);
command2(0xDC, 0x02); // This line stops the display from working (cursor and display enabled elsewhere) commenting it out makes the code work
//command2(0xDC, d->sd_reg_function_select_c)
//command2(0x23, d->sd_reg_blink_fade);
clear_sd(d);

The weird part is that I've tried all possible values for VSL bit and GPIO bits and they all keep the display from turning on. Never sending the command to 0xDC** is the only way to get it to work.

I can post more code if needed
Title: Re: Problem setting "function select c" register
Post by: Saurabh_B on May 04, 2016, 08:38:51 AM
The VSL pin is left open on these displays, modifying this value might make the display not work.

However I don't believe that the value is 0x02 on Reset. I believe that 0x02 might actually reset some registers on the display.
In our recommended initialization sequence we do set the whole register to 0.
Title: Re: Problem setting "function select c" register
Post by: jonmon6691 on May 04, 2016, 01:10:09 PM
I tried writing 0xDC00 to that register and still have the same problem.

Is there a way to query the value of a register? The only reason that I'm writing to it, is that my library maintains the POR state of all the registers locally. This allows me to change individual bits and keep track of the state of the other bits in the same register. This requires a register sync during initialization in which I write a known state into every register. It's not strictly necessary to do this with function select c, since I have no immediate use for it, but I would like it to work for the sake of completeness. This would all be unnecessary of course, if the state of the internal registers could be read back.

Here's where I got 0x02 as the power on state, I was assuming (RESET) was meant to indicate the POR value
(http://i.imgur.com/JMm7S2s.png)
Title: Re: Problem setting "function select c" register
Post by: Saurabh_B on May 04, 2016, 02:44:37 PM
Unfortunately there is no way to read the individual registers for this display.
However when you do change the value of this register it does disable your display.

Looking at the datasheet I would have also assumed that the POR was 0x02. The rest of the commands on the controller datasheet have the default values labeled as (POR) rather than (Reset).
Since these are GPIO pins, I am assuming that it is referring to the physical act of "resetting" these pins, or putting them into a low state.