Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?


Closed Thread
Results 1 to 37 of 37
  1. #1
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    I just transitioned a new product design from a WINDSTAR 2x16 LCD to a NEWHAVEN 2x8 LCD to save a few bucks parts cost and some panel space on the product front panel, plus the NEWHAVEN operates without a backlight. I had the PBPro code working fine with the WINDSTAR while using it as a 4-bit interface display. I notice that the WINDSTAR LCD uses a ST7006U controller while the NEWHAVEN uses a SPLC780D, but the Command/Instruction tables are identical for both LCDs. I presumed that since the NEWHAVEN LCD is also a 4-bit interface display, has exactly the same electrical interface, and the Instruction Table is the same, that all I would have to do is change those lines of code that placed the characters on each line so that they fit inside of the 8 available characters per line. In fact, I can't get any characters to appear on the screen of the NEWHAVEN display. The Newhaven data sheet includes example initialization routines in C, but I don't understand C so can't replicate in PBPro. I am attaching my PBPro initialization routine for the WINDSTAR and the C code routines for the NEWHAVEN. Can anyone advise me how to change my PBPro code to match this C code??
    Code:
    InitializeDisplay:  ' Subroutine to initialize 2X16 LCD display      
    '=================
      '-----SETUP FOR USING 2x16 LCD THAT IS INSTALLED IN EASYPIC6--------
         ' Blink LED_GRN twice to indicate entered IntializeDisplay
               For i = 0 to 1
                   HIGH LED_GRN
                   Pause 500
                   LOW LED_GRN
                   PAUSE 500
               Next
                 
         ' LCD DEFINES FOR USING 2x16 LCD with PortA in EASYPIC6
               DEFINE LCD_DREG PORTA    ' Use PORTA for LCD Data
               DEFINE LCD_DBIT 0        ' Use lower(4) 4 bits of PORTA
                                          ' PORTA.0 thru PORTA.3 connect to
                                          ' LCD DB4 thru LCD DB-7 respectively
               DEFINE LCD_RSREG PORTA   ' PORTA for RegisterSelect (RS) bit
               DEFINE LCD_RSBIT 4       ' PORTA.4 pin for LCD's RS line
               DEFINE LCD_RWREG PORTC   ' LCD read/write port
               DEFINE LCD_RWBIT 2       ' LCD read/write bit
               DEFINE LCD_EREG PORTA    ' PORTA for Enable (E) bit
               DEFINE LCD_EBIT 5        ' PORTA.5 pin for LCD's E line
               DEFINE LCD_BITS 4        ' Using 4-bit bus
               DEFINE LCD_LINES 2       ' Using 2 line Display
               DEFINE LCD_COMMANDUS 1500' Command Delay (uS)
               DEFINE LCD_DATAUS 44     ' Data Delay (uS)
           
        ' DEFINE LCD Control Constants  
               Line1   CON 128          ' Point to beginning of line 1 ($80) 
               Line2   CON 192          ' Point to beginning of line 2 ($C0)
        
        ' Test the LCD during initialization
               LCDOut $fe,1:FLAGS=0:Pause 250      ' Clear Display
               LCDOut $fe,Line1+3," LCD TEST "     ' Display on 1st line
               Pause 500
               LCDOut $fe,Line2+2,"..Power On..!!" ' Display on 2nd line
               PAUSE 1000
    Return
    Here is the C code routines that came with the NEWHAVEN:

    Code:
    4-bit Initialization:
    /**********************************************************/
    void command(char i)
    {
    P1 = i; //put data on output Port
    D_I =0; //D/I=LOW : send instruction
    R_W =0; //R/W=LOW : Write
    Nybble(); //Send lower 4 bits
    i = i<<4; //Shift over by 4 bits
    P1 = i; //put data on output Port
    Nybble(); //Send upper 4 bits
    }
    /**********************************************************/
    void write(char i)
    {
    P1 = i; //put data on output Port
    D_I =1; //D/I=HIGH : send data
    R_W =0; //R/W=LOW : Write
    Nybble(); //Clock lower 4 bits
    i = i<<4; //Shift over by 4 bits
    P1 = i; //put data on output Port
    Nybble(); //Clock upper 4 bits
    }
    /**********************************************************/
    void Nybble()
    {
    E = 1;
    Delay(1); //enable pulse width >= 300ns
    E = 0; //Clock enable: falling edge
    }
    /**********************************************************/
    void init()
    {
    P1 = 0;
    P3 = 0;
    Delay(100); //Wait >15 msec after power is applied
    P1 = 0x30; //put 0x30 on the output port
    Delay(30); //must wait 5ms, busy flag not available
    Nybble(); //command 0x30 = Wake up
    Delay(10); //must wait 160us, busy flag not available
    Nybble(); //command 0x30 = Wake up #2
    Delay(10); //must wait 160us, busy flag not available
    Nybble(); //command 0x30 = Wake up #3
    Delay(10); //can check busy flag now instead of delay
    P1= 0x20; //put 0x20 on the output port
    Nybble(); //Function set: 4-bit interface
    command(0x28); //Function set: 4-bit/2-line
    command(0x10); //Set cursor
    command(0x0F); //Display ON; Blinking cursor
    command(0x06); //Entry Mode set
    }
    /**********************************************************/

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Try bumping up the LCD_COMMANDUS value.

    1500 is just Under the minimum for that display (according to the datasheet).

    1600 should work, but try 2000.
    <br>
    DT

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Wink 2 votes ...

    Hi,

    I confirm ... LCD Commandus = 2000 !

    I do not know why, but ALL the 2x8 LCDs I have used so far always look a bit " lazy " ...and they only work with Lcd_Commandus set to 2000 !!!


    I just made the test with a 2x16 LCD, SPLC780D controller display ... no difference with either 1500 or 2000 ... so, where's the truth ???

    Experiece told ... 2000 works @ each time !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Difference in Clear Display commands make a difference?

    Quote Originally Posted by Acetronics View Post
    I confirm ... LCD Commandus = 2000 !
    Darrel/Alain,
    I tried 2000 and also 3000 and the LCD module still doesn't display any characters, but I still know it is alive by rotating the contrast potentiometer near 0 ohms and the block letters appear on line 1 of the display. But no characters when transmitted,no matter what contrast setting.

    I noticed one very suttle difference in the Command table between the two devices for the "Clear Display" command that I am wondering if it makes a difference...and if so how I would modify my PBP code to make the change in the command. The two command tables are attached as images.
    Attached Images Attached Images   

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Jellis,

    I think the problem is your Line 1 and 2 start address. "$80 $C0"
    Try $00 - Line 1 and $40 Line 2

    Hope this helps

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Code:
         ' LCD DEFINES FOR USING 2x16 LCD with PortA in EASYPIC6
               DEFINE LCD_DREG PORTA    ' Use PORTA for LCD Data
               DEFINE LCD_DBIT 0        ' Use lower(4) 4 bits of PORTA
                                          ' PORTA.0 thru PORTA.3 connect to
                                          ' LCD DB4 thru LCD DB-7 respectively
               DEFINE LCD_RSREG PORTA   ' PORTA for RegisterSelect (RS) bit
               DEFINE LCD_RSBIT 4       ' PORTA.4 pin for LCD's RS line
               DEFINE LCD_RWREG PORTC   ' LCD read/write port
               DEFINE LCD_RWBIT 2       ' LCD read/write bit
               DEFINE LCD_EREG PORTA    ' PORTA for Enable (E) bit
               DEFINE LCD_EBIT 5        ' PORTA.5 pin for LCD's E line
    Are you doing something different?

    The EASYPIC6 schematic says the LCD is on PORTB.
    <br>
    DT

  7. #7
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Tried it...didn't work.

    Quote Originally Posted by mark_s View Post
    I think the problem is your Line 1 and 2 start address. "$80 $C0"
    Try $00 - Line 1 and $40 Line 2
    I tried that, Mark, and it didn't make any difference.
    Where did you get the info of start of line 1 at $00 and start of line 2 at $40 for the NEWHAVEN LCD? I went through the data sheet for the NEWHAVEN display very throroughly and couldn't find anywhere that it specifies the 1st character address in Line 1 or Line 2. For that matter, I also went through the data sheet for the WINSTAR LCD and it doesn't show $80 or $C0 either.

  8. #8
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default LCD interface is PortA and DEFINES the same for both LCDs.

    Quote Originally Posted by Darrel Taylor View Post
    Are you doing something different?

    The EASYPIC6 schematic says the LCD is on PORTB.
    <br>
    Yes, Darrel, I have the LCD hooked up to PortA in my development setup on the EasyPic6 via a Port expander with a ProtoBoard.
    I also have the prototype PCB board laid out so that the LCD is connected to PortA in the same way as I have it working on the EasyPic. So my LCD DEFINES are correct (at least for the WINSTAR) and work on the EasyPic configuration with the WINSTAR LCD, but they don't on the prototype PCB with the NEWHAVEN display. Hope this makes it more clear.
    NEWHAVEN tech support told me that as long as I saw the character dot matrix blocks on Line 1 of the display whenever it is powered up but with contrast to a minimum, it means the module is alive. That is my situation, but still can't get characters to display. I have sent this posting to NEWHAVEN to see if they can tell me why my PBP initialization isn't working, but doubt they will since their examples for their module are all in C.

  9. #9


    Did you find this post helpful? Yes | No

    Default

    I found the line address in the Newheaven data sheet. The bottom of
    page 6. But it could be something else?

  10. #10
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jellis00 View Post
    Yes, Darrel, I have the LCD hooked up to PortA in my development setup on the EasyPic6 via a Port expander with a ProtoBoard.
    Another silly question ...

    Do you have a pull-up resistor on RA4?
    <br>
    DT

  11. #11
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default No pull-up resistor

    Quote Originally Posted by Darrel Taylor View Post
    Another silly question ...

    Do you have a pull-up resistor on RA4?
    <br>
    RA4 is connected in both my EasyPic6 development configuration and in my PCB prototype to the RS pin of the LCD. No Pull-up resistor is used in either case, and why do you ask?....from LCD data sheet the Register-Select is either 0 for command or 1 for data and therefore I didn't think it should have a pull-up resistor but should float free....am I wrong?

  12. #12
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    On many chips, RA4 is Open-Collector and won't drive the pin high on it's own.

    I'm assuming you're still using an 18F4550.

    The datasheet doesn't specify, but in ISIS with an 18F4550, the LCD won't initialize without a pull-up.

    It could just be a simulator thing.

    Try it.
    Stick a pull-up in there.
    <br>
    DT

  13. #13
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Pull-up didn't help

    Quote Originally Posted by Darrel Taylor View Post
    On many chips, RA4 is Open-Collector and won't drive the pin high on it's own.

    I'm assuming you're still using an 18F4550.

    The datasheet doesn't specify, but in ISIS with an 18F4550, the LCD won't initialize without a pull-up.

    It could just be a simulator thing.

    Try it.
    Stick a pull-up in there.
    <br>
    Tried a 10K pull-iup on RA4 and still no characters appearing on LCD. Going to hook up oscilloscope next to the various LCD interfaces to see if I can figure out what is going on.

    I don't know what ISIS is or what you mean by it could be just a simulator thing. Is ISIS a simulator?

    For your info I asked Microchip tech support about whether RA4 on 18F2550/4550 is open-collector or not and whether there should be any problem of it driving RA4 high with an LCD interface and here is their response:
    ----
    Hi,
    Thank you for contacting Microchip Technical Support.
    RA4 can drive the pin High, please configure all the Port pin of PortA to digital by setting the bit in PCFG0-PCFG3 in ADCON1 Register.
    For further assistance, do write to us with the following details.
    1) Please attach your code along with MPLAB IDE workspace.(MCP and MCW files)
    2) C18 -Version?
    3) MPLAB version?
    4) Screen shot of the disassembly listing in the view tab.
    Awaiting for your reply
    Thanks & Regards,
    Microchip Technical Support

  14. #14


    Did you find this post helpful? Yes | No

    Default

    Also could be as simple as a contrast voltage issue (Vo). Do you have a pot on the Vo pin?

    Also noticed pin 15 and 16 of the New Haven display are listed as NC in the data sheet, but the example schematic shows them as A+ and K- and shows then both grounded. So maybe you need some clarification from New Haven on how to connect up the display.
    Tim Barr

  15. #15
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Thanks for comments

    Quote Originally Posted by falingtrea View Post
    Also could be as simple as a contrast voltage issue (Vo). Do you have a pot on the Vo pin?

    Also noticed pin 15 and 16 of the New Haven display are listed as NC in the data sheet, but the example schematic shows them as A+ and K- and shows then both grounded. So maybe you need some clarification from New Haven on how to connect up the display.
    Yes, I have a 20K ohm potentiometer connected as a Vo source for controlling contrast. I see the black matrix dots on the 1st line of the display when I power up with the pot set near 0 ohms....that is how Newhaven said I could tell if the LCD is alive and well and hasn't been zapped.

    You are right, that on the prototype PCB pins 15 and 16 are connected to ground...did that because that is wn on scheamtic on Page 4 of the LCD data sheet.....but we checked with Newhaven tech support and they said it doesn't make any difference whether pins 15 and 16 are grounded or left un connected for this particular module that doesn't have a backlight.

    Thanks for the comments, anyway...they help me keep thinking.
    Last edited by jellis00; - 14th April 2010 at 22:43.

  16. #16


    Did you find this post helpful? Yes | No

    Default

    Did you see the data sheet for line addresses? Look for "DDRAM" bottom page 6 in the LCD data sheet.

    Also have you set ADCON1 to %00001111 for all digital on porta?

  17. #17
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Are you SURE you have the pinout correct on the New Haven display? It MAY not be the same as the windstar...

    I know nothing of Windstar, but I use quite a few Lumex displays, and have recently started using some New Haven displays, and the pinout on the NewHaven that I'm using is NOT the same as the Lumex.

    Lumex :

    Pin1 = Ground
    Pin2 = Vdd
    Pin3 = Contrast adjust

    New Haven:

    Pin1 = Ground
    Pin2 = Contrast adjust
    Pin3 = Vdd

    All other pins are the same except for 2 & 3 being swapped between NewHaven and Lumex.
    Can't vouch for the Windstar, but you might want to have a look at the data sheets again?


    Steve

  18. #18
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Byte_Butcher View Post
    ... and the pinout on the NewHaven that I'm using is NOT the same ...
    Awesome!
    Didn't see that coming, and I was looking at the datasheet, which agrees with you.

    Easy enough to test.
    Jellis, If you turn the contrast pot the other way, does it start smoking?
    OK, probably not the best way to test it.

    Add: Probably wouldn't anyway's, rats.
    <br>
    Last edited by Darrel Taylor; - 15th April 2010 at 00:18. Reason: add
    DT

  19. #19
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    I had a similar issue with a 16 x 2 LCD, which turned out required a voltage range between -5v and +5, and seemed to offer the ideal contrast when the voltage was around -3.5v

    Not saying this is the cause (haven't looked at the datasheet for your display), but it did catch me out.

  20. #20
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    When I bought my Newhaven displays, the pinout difference stood out immediately to me in the data sheet.
    On the Lumex, and all other displays I've used, the Vss, Contrast, and Vdd pins are laid out in a row with the contrast in the middle like the pins on a pot usually are, with a voltage across the "outer" legs and the wiper in the middle.

    The out of sequence power / contrast / ground sequence caught my eye right off.

    Sorry I didn't mention it sooner. I didn't think about it until the word "Newhaven" came up again in one of the later posts and sparked a brain cell....

    I hope that's the problem for Jellis00 !


    Steve

  21. #21
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Newhaven LCD interface

    Quote Originally Posted by Byte_Butcher View Post
    The out of sequence power / contrast / ground sequence caught my eye right off.

    Sorry I didn't mention it sooner. I didn't think about it until the word "Newhaven" came up again in one of the later posts and sparked a brain cell....

    I hope that's the problem for Jellis00 !
    Unfortunately not, Steve.
    Here is data right out of the data sheet for my display and Contrast Vo is in the right plac:.
    Pin No. Symbol Function Description
    1 Vss Power Supply Ground
    2 VDD Power Supply Supply voltage for logic (+3.3V)
    3 V0 Power Supply Power supply for contrast (approx. 0.3V)

    My MCU interface to the Newhave LCD is correct with their data sheet and is shown in attached image. Still looking for the problem.
    Attached Images Attached Images
    Last edited by jellis00; - 15th April 2010 at 03:06. Reason: enter table of pins

  22. #22
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Well that's a tough nut to crack...

    Did I miss it or is there link to the Data Sheet for your newhaven display somewhere?


    steve

  23. #23
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Here is URl to the LCD spec

    Quote Originally Posted by Byte_Butcher View Post
    Well that's a tough nut to crack...

    Did I miss it or is there link to the Data Sheet for your newhaven display somewhere?
    You can get the spec on this display I am using at this URL:

    http://www.newhavendisplay.com/index...roducts_id=258

  24. #24
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I know you tried COMMANDUS 3000, have you also tried bump up DATAUS? I have some displays(brand???) that need COMMANDUS 3000 and DATAUS 150.

    Silly question...
    Is the ADC stuff off..?
    Dave
    Always wear safety glasses while programming.

  25. #25
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Problem finally solved!

    I am totally embarrassed to tell everyone I found the problem....and it was one of my own making. I had an intermittent trace on the PCB between the MCU pin and the LCD's R/W pin. I wouldn't have found this if Darrel Taylor hadn't sent me a manual initialization routine that (as he said) if the LCD didn't work with it, it never would. When it didn't work it forced me to go back aqnd re-verify the PCB interfaces to the LCD. I had done this before but somehow missed the bad R/W interconnect....I suppose it was intermittenly working at the time.

    At any rate, I totally appreciate all the good advice I received on this thread. The people that support this forum are the best.

    As a small token of "give back" I am posting my final code for the routine that now works with the NEWHAVEN displays. I highly recommend them...they are low cost ($8.25 ea) and even though they don't require a backlight their reflectance performance gives a very readable display in even low light conditions....plus their tech support is outstanding.
    Here is code for initializing their 2x8 LCD modules...they have one for 5vdc operation and one for 3vdc operation that has exactly the same physical and electrical interfaces...and both at $8.25.

    InitializeDisplay: ' Subroutine to initialize NEWHAVEN NHD-0208AZ-RN-YBW
    '================= ' 2x8 LCD2X8 LCD display

    ' Blink LED_GRN twice to indicate entered IntializeDisplay
    For i = 0 to 1
    HIGH LED_GRN
    Pause 500
    LOW LED_GRN
    PAUSE 500
    Next

    ' LCD DEFINES FOR USING 2x8 LCD with PortA
    DEFINE LCD_DREG PORTA ' Use PORTA for LCD Data
    DEFINE LCD_DBIT 0 ' Use lower(4) 4 bits of PORTA
    ' PORTA.0 thru PORTA.3 connect to
    ' LCD DB4 thru LCD DB-7 respectively
    DEFINE LCD_RSREG PORTA ' PORTA for RegisterSelect (RS) bit
    DEFINE LCD_RSBIT 4 ' PORTA.4 pin for LCD's RS line
    DEFINE LCD_RWREG PORTC ' LCD read/write port
    DEFINE LCD_RWBIT 2 ' LCD read/write bit
    DEFINE LCD_EREG PORTA ' PORTA for Enable (E) bit
    DEFINE LCD_EBIT 5 ' PORTA.5 pin for LCD's E line
    DEFINE LCD_BITS 4 ' Using 4-bit bus
    DEFINE LCD_LINES 2 ' Using 2 line Display
    DEFINE LCD_COMMANDUS 10000' Command Delay (uS)
    DEFINE LCD_DATAUS 100 ' Data Delay (uS)

    ' DEFINE LCD Control Constants
    Line1 CON 128 ' Point to beginning of line 1 ($80)
    Line2 CON 192 ' Point to beginning of line 2 ($C0)

    ' Test the LCD during initialization
    LCDOut $fe,1:FLAGS=0:Pause 250 ' Clear Display
    LCDOut $fe,Line1,"LCD TEST" ' Display on 1st line
    Pause 500
    LCDOut $fe,Line2,"Power On!" ' Display on 2nd line
    PAUSE 1000
    Return

  26. #26
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Bumping this old thread as I'm about to use a Newhaven display for the first time. I have a NHD-0216K1Z-NSRGB-FBW 16x2 5.0V display. http://www.newhavendisplay.com/specs...-NSRGB-FBW.pdf I'll be using a 18F2550 for the first time. The LCD will be on portB and in 4 bit mode.

    Looking at the above working code, is that really a 10000us delay? What does the FLAGS=0 mean?

  27. #27
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Quote Originally Posted by jmgelba View Post
    Looking at the above working code, is that really a 10000us delay?
    Yes, it was, but this code was a very early version of my attempts to make it work. I just looked up in my latest code and I am now using the following statements that work with the display I am using, the NHD-0208AZ-RN-YBW:
    DEFINE LCD_COMMANDUS 1500 ' Command Delay (uS)
    DEFINE LCD_DATAUS 44 ' Data Delay (uS)
    You may have to play with these values for your particular display module. Also don't be afraid to call Newhaven tech support...they are outstanding and helped me a great deal.
    What does the FLAGS=0 mean?
    Go to the page in the PicBasic Pro Compiler manual (it is also online if you can't find your manual) and look up the page that describes the use of the command LCDOUT. It explains what FLAGS=0 is used for. It is used to reset an internal flag to tell the program to initialize it the next time it uses LCDOUT after having been powered down and then powered back up. Very important if you are shutting off power to the LCD during the program when it is not being used to save battery power. That is why I used it.

    I hope all of this helps.

    BTW, one of the ongoing problems many people have had who use the NEWHAVEN LCD display modules is how to get a clean looking mounting, which normally requires a bezel. Bezels are hard to come by for these displays. I found a company that has a good set, one which worked with mine. Go to http://www.rmfproducts.com to see what they offer. Prices are also reasonable....their Model 140-1 for my LCD display size only costs $2.15 each in quantities of 1-99, and $2.00 each for 100 or more.

    I hope all this helps you.
    /s/ John Ellis

  28. #28
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Thank you for that wealth of information.

    This display will be mounted in a custom cast aluminum enclosure with a graphical overlay over the top. This will also contain the push buttons, the bezel info is good to know. The project is a control and monitor for a 400W LED driver.

    Which PIC did you end up using?
    Last edited by jmgelba; - 9th March 2011 at 20:44.

  29. #29
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Quote Originally Posted by jmgelba View Post
    Which PIC did you end up using?
    Because most of my applications have a USB interface, I have favored using either the 18F2550 or 18F4550. If you don't need a USB interface these are probably over kill, but they are so low in price and have so many IO pins, they are a good choice even if you don't need the USB. I use the 18F2550 whenever I can because it is a 20 pin IC and a lot smaller than the 4550 for board layout. I published an article in the recent Forum Competition that you can see by going to that location on the Home page. Mine is the Ultrasonic Ranger application and all of my code is posted there, including the routines that intialize and use the NEWHAVEN display.

  30. #30
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Nice. I'm also using a 18F2550 - for the first time. I've started browsing through the datasheet and am currently finishing up the schematic and about to start on the layout.

    This project calls for several analog in's, the LCD, the USB, 4 switch inputs, and control of a digital pot. Oh and a couple of indicator LED's.

    Nothing like jumping in with both feet!

  31. #31
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    So it soounds like you are still building schematic/layout and haven't started coding yet??
    When you get into the coding of the USB interface you will probably run into problems. I did, and got a lot of help from Darrell Taylor and the Forum. When you get to that stage and need help, let me know and I may be able to refer you to some well hidden postings that will help you with the USB.

  32. #32
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Correct.

    I've done a little searching and found the keep alive requirements and DT's keep alive program. Other than that, and the requirement for a 0.47uF cap on the USB supply pin, I havent gotten too far in to it. I'm concentrating on hardware as the first rev pcb has to work first time. I need to send out a somewhat functioning proto next week.


  33. #33
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Are you using your display in 4 bit or 8 bit and if its 4 bit, have you tied the unused data pins to ground?

  34. #34
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Quote Originally Posted by jmgelba View Post
    Are you using your display in 4 bit or 8 bit and if its 4 bit, have you tied the unused data pins to ground?
    I am using it in 4-bit and yes the unused data pins have to be grounded.

  35. #35
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Thanks. Incidentally, the datasheet from Digikey for the part number I'm using is incorrect. It didnt show how to connect the RGB backilighting correctly. Good job I double checked by calling New Haven tech support. The pin out was wrong - missing 2 pins and swapping the backlight A and K. Yikes Digikey!!

  36. #36
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    Quote Originally Posted by jmgelba View Post
    Thanks. Incidentally, the datasheet from Digikey for the part number I'm using is incorrect. It didnt show how to connect the RGB backilighting correctly. Good job I double checked by calling New Haven tech support. The pin out was wrong - missing 2 pins and swapping the backlight A and K. Yikes Digikey!!
    Which LCD model of theirs are you using?
    Did Newhaven warn you about incorrect data sheets on any other LCDs of theirs that are sold at DigiKey?
    JE

  37. #37
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Code that worked with WINDSTAR LCD doesn't work with Newhaven LCD?

    NHD-0216K1Z-NSRGB-FBW

    New Haven did not warn me of any other issues with data sheets. It looks like Digikey has an early version of the correct datasheet that contains errors, as the part number of the device and the datasheet do match. However the data sheet downloaded directly from New Haven is definitely different.

    Take a look at page 3 of this link: http://www.newhavendisplay.com/specs...B_FBW-REV1.pdf

    And take a look at pages 3 and 4 of this link: http://www.newhavendisplay.com/specs...-NSRGB-FBW.pdf

    The second link is from Digikey and pages 3 and 4 clearly show 16 pins, not 18 per the actual device. The correct pinout is pins 16, 17 and 18 are the anodes for red, green and blue respectively. Pin 15 is the cathode pin.

    The digikey link shows pin 15 as anode and pin 16 as cathode.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts