LCD display on PICDEM 2 Plus board


Closed Thread
Results 1 to 3 of 3
  1. #1
    klausmikkelsen's Avatar
    klausmikkelsen Guest

    Default LCD display on PICDEM 2 Plus board

    I am brand new to Microchip controllers, but have extensive experience with Motorola, especially the cpu32K line.

    Have a PICDEM 2 Plus board with an 18F452 that I can make do what I want with the exception of the LCD. It is in 4 bit data mode RD0-RD3 and control bits on RA 1,2 and 3 for E, R/W and RS respectively.

    I am using the following lines of code. Any suggestions?




    DEFINE OSC 4

    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 3
    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 1
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2

    TRISA = $00
    TRISD = $00
    PORTA.2 = 0
    PAUSE 1000

    LOOP:
    LCDOUT $FE, 1
    PAUSE 100
    LCDOUT $FE, $0F
    PAUSE 100
    LCDOUT $FE, $80
    PAUSE 100
    LCDOUT "Hello"
    PAUSE 100

    GOTO LOOP


    Thanks,

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You could try the following...

    Firstly since the R/W line is connected you should define it along with the other LCD defines...

    DEFINE LCD_RWREG PORTA
    DEFINE LCD_RWBIT 2

    Secondly, as in most PIC's with multiplexed Analogue inputs on PortA, the default on power-up for RA0, 1, 2, 3 and 5 is Analogue mode. You need to switch those pins to Digital mode. Add this statement along with your TRISA etc...

    ADCON1=$07

    See section 17 of the 18F452's Datasheet for an explaination of what I've done.

    Hopefully that will get you up and running.

    Melanie

  3. #3
    klausmikkelsen's Avatar
    klausmikkelsen Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks, Melanie, that worked like a charm.

Similar Threads

  1. LCD Display board
    By tazntex in forum General
    Replies: 3
    Last Post: - 4th December 2008, 18:57
  2. Help with 18F4520 on PICDEM 2 Plus Demo Board 2006
    By kennYy in forum mel PIC BASIC
    Replies: 2
    Last Post: - 28th April 2008, 16:12
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. 2 decimal display on LCD
    By pt3rg in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th January 2004, 14:28

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