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.


Topics - RichardR

Pages: [1]
1
OLEDs / NHD‐0420CW‐AG3: blinking part of text?
« on: March 02, 2016, 07:06:21 AM »
Hello,
I have one more question about the NHD‐0420CW‐AG3 OLED display: is it possible to make some text blink?

I'm using the display to control a machine, and in some situations, I want to show the word 'PAUSED' blinking, with the rest of the text static. I found blink on/off functions for the cursor and for the display as a whole, but not for just part of the text, e.g. defined like this:

[text (static)]
[command: blink enable]
[text (blinking)]
[command: blink disable]
[text (static)]

Or do I have to take care of this myself, periodically overwriting the blink text with spaces?

Thanks once more in advance,

Richard Rasker

2
OLEDs / NHD‐0420CW‐AG3 Contrast question
« on: December 28, 2015, 01:57:48 PM »
Hello,

Thanks to Saurabh's good advice, I managed to get the NHD‐0420CW OLED display working properly. I have however a question about the contrast function. I'm using the following commands to set the contrast:

Code: [Select]
command(0x2A); //function set (extended command set)
command(0x79); //OLED command set enabled
command(0x81); //set contrast control
command(0x7F); //set contrast value
command(0x78); //OLED command set disabled
command(0x28); //function set (fundamental command set)

And yes, this seems to work, but while the contrast value can be set between 0x00 and 0xFF (with 0x7F as the default value), the effect is tiny -- the difference between 0x00 and 0xFF is perhaps a 30% change in visible brightness (at first, I thought that it didn't work at all).

The same goes for the fade function:

Code: [Select]
command(0x2A); //function set (extended command set)
command(0x79); //OLED command set enabled
command(0x23); //fade/blink function
command(0x30); //blink, with step every 8 frames
command(0x78); //OLED command set disabled
command(0x28); //function set (fundamental command set)

The display brightness only changes marginally (hardly visible), and only at the lowest point it goes completely black for a moment.

Did I perhaps do something wrong with setting up registers? Or is the actual contrast range indeed very small? Or could I have damaged the display? (I think I once set the display for 2.8V I/O instead of 5V while testing, but that doesn't appear to have damaged anything else).

Thanks once again!

Best regards,

Richard

3
Hello,
I'm trying to get an OLED display type NHD‐0420CW‐AG3 working with a 16F1789 PIC controller, via I2C.
Unfortunately, even after several days of digging through the datasheets, checking out code examples, and just trying to get things working, I still can't get anything to show. No doubt, this has to do with the facts that
1. This is the first time that I try to use I2C with a PIC controller,
2. I'm working in assembler, not C or another higher language, and
3. There are some things in the display datasheet unclear to me.
As far as I can tell, the electrical signals should be OK, and from what I can see, and at least the I2C Start condition is initiated. But after that, nothing much happens. So my problems may very well be due to programming error.

If I may address the last point first: I understand most things in the display datasheet, except the table with the display commands.
There, three yellow columns labeled IS, RE, and SD are shown. What are these bits, and how are they addressed? Even the far more elaborate US2066 datasheet doesn't explain this -- or are these bits implicit in the command sent? If so, what is their function? Or did I overlook something here? I really tried reading the datasheets thoroughly, but still haven't a clue what these three bits are supposed to be. Also, I'm afraid that I don't completely understand Figure 5-7 in the US2066 datasheet (the I2C bus data format), even though I understand the basics of I2C communication itself.

Then there's the actual I2C addressing. I try sending simple byte sequences to the display, but it doesn't appear to respond at all, so I must be doing something wrong.
In the US2066 datasheet, I see that the display's slave address is supposed to be 0x78, OR'ed with SA0 (=0 in my case), and R/W (=0 so far). The following byte is supposed to be the control byte, to indicate the nature of the next byte (command or data), with 0x80 (Co=1, D/C#=0) for commands, and 0x40 (Co=0, D/C#=1) for data.

So I tried sending the following to the display from the PIC16F1789, translated from the example program code in the display datasheet:

[Initiate Start condition]
0x78 (address)
0x80 (command code)
0x01 (clear display)
0x80 (command code)
0x02 (return home)
0x04 (data code)
0x1F (write one solid block in first position)
[Initiate Stop condition]

Unfortunately, this doesn't do anything. I tried breaking this up in single commands, each one preceded by the address and terminated by a Stop condition, but that also doesn work properly.
It is very well possible that my PIC ASM code is to blame -- when I try sending these bytes without using the I2C block interrupt mechanism, the I2C bus immediately hangs after initiating the Start condition. When trying to send subsequent bytes through the proper interrupt routine, the I2C bus appears to function properly, but still nothing shows. In the US2066, there's also a description of a Power ON sequence, by sending fundamental command 0x0C, with RE=0, and SD=0(?). Should I use this first?

So actually I hope that my question is simple: is at least the above sequence of bytes sent out correct? If not, then what should be the correct sequence to turn on the display, and to get at least one character to show?
As long as I know that I should be sending out the right byte sequences, I can more easily figure out what I'm doing wrong in my assembly code. I tried locating I2C code examples, but there's very little to be found in PIC assembly code (at least I couldn't find anything).

Thanks in advance for any hints,

Best regards,

Richard

Pages: [1]