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

Pages: [1]
Character LCDs / NHD-0220GZ-FSW-GBW-L
« on: April 10, 2014, 12:44:11 AM »
I have installed this display for 4-bit mode and am using PicBasic Pro.    I have used various similar character displays in the past without issue with PB Pro.  This is my first experience with Newhaven.  I have had some success getting characters on line 1, but nothing ever on line 2.  I found the PicBasic sample code and gave that a try with the appropriate port and bit changes in the DEFINEs.  This does not work either.  After some delay, I get an underline cursor and a flashing block cursor at the beginning of line 1. That's it.
The pic processor is PIC18F26K22.
Here is a copy of the test code -

InitializeDisplay:  ' Subroutine to initialize NEWHAVEN NHD-0208AZ-RN-YBW
'=================  ' 2x8 LCD display                   
     ' LCD DEFINES FOR USING 2x8 LCD with PortC
           DEFINE LCD_DREG PORTC    ' Use PORTC for LCD Data
           DEFINE LCD_DBIT 0        ' Use lower(4) 4 bits of PORTC
                                      ' PORTC.0 thru PORTC.3 connect to
                                      ' LCD DB4 thru LCD DB-7 respectively
           DEFINE LCD_RSREG PORTC   ' PORTC for RegisterSelect (RS) bit
           DEFINE LCD_RSBIT 4       ' PORTC.4 pin for LCD's RS line
           DEFINE LCD_RWREG PORTC   ' LCD read/write port
           DEFINE LCD_RWBIT 5       ' LCD read/write bit
           DEFINE LCD_EREG PORTC    ' PORTC for Enable (E) bit
           DEFINE LCD_EBIT 6        ' PORTC.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

The following code will display LCD on line one starting at the first character position.  If I leave out the starting space, I get nothing.  If I use LCDOUT $fe, $80, " LCD", I get nothing.

   Pause 100      ' Wait for LCD to start up
   lcdout $fe, 1
   lcdout $fe, $0c
    Lcdout $fe, 1      ' Clear screen
 pause 500
    LCDOUT $fe, " LCD"

I have rechecked my pc board wiring over and over and can't find any error. 

Any help is much appreciated.  Thanks.

Pages: [1]