2x16 LCD Module with HD44780 + 16F877A


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    I'll try the contrast in the morning, i think i got a 10K pot somewhere...

    I just wrote a simple "hello world" type LCD test program...

    I loadedit into oshonsoft's pic simulator and configured it's LCD module...
    Acording to the microcontroller view, all the data lines switch to outputs...
    However, it gets into a loop with nothing displayed in the LCD module, and tmr1 prescaler is continueously counting up by 1 each loop but over flows without a change in instructions...

    :edit after about 17000us in simulation RD0, RD1,RD5 and RD4 to high... still nothing on LCD module

    :edit after 22000us in simulation it has now started putting charecters on the LCD...
    Last edited by comwarrior; - 19th August 2009 at 02:26.

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


    Did you find this post helpful? Yes | No

    Default

    Just for giggles, can we see the whole code?
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Code:
    @ device pic16F877A, HS_OSC
    @ device WDT_OFF
    @ device PWRT_OFF
    @ device BOD_OFF
    @ device LVP_OFF
    @ device WRT_OFF
    @ device CPD_OFF
    @ device DEBUG_OFF
    
    Define  OSC				4						' Set clock speed
    DEFINE  SER2_BITS		8						' Ser2 number of data bits
    DEFINE LCD_DREG PORTD		'LCD data port
    DEFINE LCD_DBIT 0			'LCD data starting bit 0 or 4
    DEFINE LCD_RSREG PORTC		'LCD register select port
    DEFINE LCD_RSBIT 5			'LCD register select bit
    DEFINE LCD_EREG PORTC		'LCD enable port
    DEFINE LCD_EBIT 7			'LCD enable bit
    DEFINE LCD_RWREG PORTC		'LCD read/write port
    DEFINE LCD_RWBIT 6			'LCD read/write bit
    DEFINE LCD_BITS 8			'LCD bus size 4 or 8
    DEFINE LCD_LINES 2			'Number lines on LCD
    DEFINE LCD_COMMANDUS 2000	'Command delay time in us
    DEFINE LCD_DATAUS 50		'Data delay time in us
    'Pause 1000
    
    loop:
    LCDOUT $FE, 1, 2, "INITIALISING"
    LCDOUT $FE, $C0, "Hello"
    goto loop

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Found it... looks like the contrast likes to be fully negative...

    Thanks for the help... Iactualy thaught the contrast should be more positive acording to all the scmatics i looked at...

    Thanks

Similar Threads

  1. 2x16 lcd not working with pic16f72
    By vu2iia in forum Schematics
    Replies: 4
    Last Post: - 16th February 2011, 15:59
  2. 2x16 lcd problem
    By k3v1nP in forum mel PIC BASIC
    Replies: 11
    Last Post: - 30th October 2008, 05:46
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  4. PIC16F684 + 8*2 LCD module
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th March 2008, 00:38
  5. Lcd 16f877a Heeeeelp!!!
    By chip15 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd December 2005, 12:51

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