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 - wb2dyb

Pages: 1 [2]
16
OLEDs / Library that works fine on the NHD-0420CW-A*3
« on: March 16, 2015, 11:23:21 PM »
I found a library that works very nicely with the 420CW displays.

https://github.com/gadjet/1602-OLED-Arduino-Library/blob/master/OLedI2C.cpp

There is one modification needed,

original:
 void OLedI2C::cursPos(uint8_t col, uint8_t row)
 {
 int row_offsets[] = { 0x00, 0x20};
 sendCommand(0x80 | (col + row_offsets[row]));
 }
 
The above works fine with two lines.

For four lines:

 void OLedI2C::cursPos(uint8_t col, uint8_t row)
 {
 int row_offsets[] = { 0x00, 0x20, 0x40, 0x60 };//**************THIS WAS THE CHANGE FOR 4 LINES
 sendCommand(0x80 | (col + row_offsets[row])); //was 0x80
 }
 

And the init has an error:

original:


 // **** Set OLED Characterization *** //
sendCommand(0x2A); // **** Set "RE"=1
sendCommand(0x79); // **** Set "SD"=1
// **** CGROM/CGRAM Management *** //
sendCommand(0x72); // **** Set ROM
sendCommand(0x00); // **** Set ROM A and 8 CGRAM

needed this change:

 // **** CGROM/CGRAM Management *** //
 sendCommand(0x72);     // **** Set ROM
 sendData(B00000011);     // **** Set ROM A and 8 CGRAM This selects CGROM A, 00000000 selects CGROM C
 // **** Set OLED Characterization *** //
 sendCommand(0x2A);     // **** Set "RE"=1
 sendCommand(0x79);     // **** Set "SD"=1

The only missing function, at least one I'd like to see is a custom character. Most controllers allow for this, and the NHD420CW does. Just not in this library. And I speak entirely about Arduino Uno. But it is doing what I needed, with the exception of needing 8 custom characters I need to represent with letters. I tried adding it but while I think I got the character creation right, for all I've looked, I cannot see how to select a custom character (anybody give me a pointer on THAT??

GeorgeC



17
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 21, 2015, 02:51:24 PM »
Paul, been down with a bug all week, finally tried this code, display's fine with 0x10 on other slim char OLEDs modification. Thanks, y'all!

I need to study what that all means now...

GeorgeC


18
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 16, 2015, 11:59:32 PM »
it didn't upload the second pix...

19
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 16, 2015, 11:57:46 PM »
Well, I get 4 lines. The picture with the arrows are the code in SPI more, the two-wide gibberish is in I2C mode...I need to give my brain a rest...

GeorgeC


20
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 16, 2015, 01:04:27 PM »
Well, it looks like it is really for I2C, seeing Wire.beginTransmission(slave2w),Wire.write(tx_packet[ix]);,  Wire.endTransmission();, and when commenting out #Wire.h and un commenting #SPI.h  get errors at "Wire". At line 330 I commented out Wire.h, which gave half as many errors. (the line 330 error goes away)The errors I get:


Arduino: 1.0.5 (Windows 7), Board: "Arduino Mega 2560 or Mega ADK"

sketch_feb16b.ino: In function 'void send_packet(unsigned char)':
sketch_feb16b:190: error: 'Wire' was not declared in this scope
sketch_feb16b.ino: In function 'void setup()':
sketch_feb16b:330: error: 'Wire' was not declared in this scope

I should try it in I2C, my project can do that with a few wire snips, but it is based on a ATMega328P (arduino Uno) and needs more adaptation.

Thanks, Paul

GeorgeC

21
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 16, 2015, 12:25:00 PM »
Thanks Paul, I'll try that in a few. I am not as stupid as I thought. I had figured that 0x01 was to clear and that with r/e tied low then 0xa0 was "next line" because it changes the DDRAM address. Figure 5-22 on the US2066 spec sheet...did I get that correct? Thanks Paul, I'll try not to be a pest about this stuff...

GeorgeC

22
OLEDs / Need (more) help/wisdom using the new NHD-0420CW-xxx
« on: February 16, 2015, 02:21:31 AM »
OK. I'm trying to understand what is going on in NHD_US2066.cpp, but being an RF jockey by trade, not really following this code. I know my problem is in there. After using the mentioned code from github, I have a display that lights. It prints a line of double sized characters, a second line of gibberish, waits two seconds and prints two lines of gibberish, waits two seconds and starts over. What I'm probably puzzling over is:

void output()  //what is this doing?
{
   int i;

        command(0x01); //what is this doing?
        delay(2);
        for(i=0;i<20;i++){
          data(text1);
        }
       
        command(0xa0); //what is this doing?
        for(i=0;i<20;i++){
          data(text2);
        }
delay(2000);
   command(0x01); //what is this doing?
        delay(2);
   for (i=0;i<20;i++){
      data(text3);
   }
   
   command(0xA0); //what is this doing?
   for (i=0;i<20;i++){
      data(text4);
   }
}

void outputTest() //what is this doing? And what is different from void output above?
{
   int i;

        command(0x01);
        delay(2);
        data('N');
        while(1);
       
        for(i=0;i<20;i++){
          data(text1);
        }
       
        command(0xA0);
        for(i=0;i<20;i++){
          data(text2);
        }
        delay(2000);

   command(0x01);
        delay(2);
   for (i=0;i<20;i++){
      data(text3);
   }
   
   command(0xA0);
   for (i=0;i<20;i++){
      data(text4);
   }
}

void blocks()
{
   int i;

        command(0x01);
        delay(2);

        for(i=0;i<20;i++){
          data(0x1F);
        }

        command(0xA0);
        for(i=0;i<20;i++){
          data(0x1F);
        }
}

void setup()
{
init16x2();
}


_____________________________________________

Has anybody worked on a NHD-0420CW/US2066 library set for Arduino similar to SPI_VFD, CUU, or LiquidCrystal? For me that would be so wonderful.

Anyhow, I know when I get this working in my project I can get rid of the big 4X20 VFD and the graphic oled currently in use. The graphics part with the u8glib library is just plain slow. The VFD is fast, but too big, fragile, uses 36 volts and has a filament...

Thanks y'all.

George Csahanin
Cedar Park, TX

23
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 09, 2015, 09:47:04 PM »
I couldn't wait, just tried it. Well, they lit up. Looks like the CGRAM is clocked wrong, each "dot" in a horizontal line is one on, blank space, one on, blank space, etc. But the words are in there two lines at a time (it's a 0420)

So I know this is going to work. Now I may try adapting to a Uno, though that may be over my head.

Thanks for the code and a  nudge in the right direction. Here's the part where I get to wish I had learned to program at an early age.

:-)

GeorgeC

24
OLEDs / Re: Need help/wisdom using the new NHD-0420CW-xxx
« on: February 09, 2015, 05:29:58 PM »
Paul, thanks, I'll give it a shot. I tried all sorts of SPI "hello world" stuff but nothing lit it up. Tried a second display (I bought three for playing) and same thing. Tried 3.3V, 5V, Mega, Uno, zip, nada. But I'll let you know how this works. I'm doing some travel, it might be several days.

Again, thanks

GeorgeC

25
OLEDs / Need help/wisdom using the new NHD-0420CW-xxx
« on: February 08, 2015, 02:24:12 AM »
Hi everyone. This new display is so much what I needed for a project. I have been using a Noritake Character VFD which proved to be too delicate and large, then one of the many SD1322 2.8" Graphic Oled display, which almost fit, but the Atmel 328 that it runs on just struggles and as a result the display will sometimes update very slowly after a command is given to the remote gear it talks to sends a reply. But it was the best I could do. So I bought a couple of the new NHD-0420CW devices from Mouser. And since it did SPI, and since the commands for the VFD looked identical to the NHD unit I figured it to be a drop in on a unit that was using the VFD version. But I can't get that to work. I first make this all work on an Arduino Uno then move that processor to the target hardware .

I probably have ten or more hours in on this already. Trying various LCD SPI sample programs. Cant find anything for the US2066 or the KS0066, which is supposedly the same. But since I compared US2066 instructions to the Noritake and others I figured it ought to work. I have tried SPI (what I need) then I2C.

Can anybody point me at sample code and driver for arduino for this? Should it work with something like the VFD code?

I really appreciate any input on this as I need to get back to my life and my day job. And this is the second night I'm up to 2:30 on this...

Thanks folks.

George Csahanin
Austin, TX

26
Very nice to see these. I've been needing this for a project that maybe I can finally complete. I used a Noritake Character VFD but the 36 volts and glass are a problem as is the size, about 4mm too wide. I got your last two NHD-0420Z-RN-GBW devices and while a slight bit too narrow, would have been fine, if I could get more. However, I just found last week that you took the displays and married them to an interface board. This is great as the redesign on the VFD was to use a 2.8" OLED graphic display using U8Glib, which while it worked, the overhead to run the graphics stuff made the display sluggish. I only need a 4 line character display. And it has to fit 93mmX34mm. The new NHD-0420CW series is ideal. Except I can't make it work, but I'll post that in the forum. I either got two bad ones from Mouser or did something incorrect on interface, or (most likely) can't substitute what looked like drivers that were identical. Your site and the world is extremely thin on info for this unit and the driver, and a sample Arduino code. I work it up on Arduino then eventually upload code to an Atmel chip.

George Csahanin

Pages: 1 [2]