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


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    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

  2. #2
    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.

  3. #3
    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

  4. #4
    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?

  5. #5
    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

  6. #6
    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 19:44.

  7. #7
    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.

Members who have read this thread : 0

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