newbie LCD to 18F4520


Results 1 to 4 of 4

Threaded View

  1. #1

    Default newbie LCD to 18F4520

    Hi all
    I am trying to get my LCD working on a pic 18F4520. (have tested the LCD on a 16f628 and it definitely works but only have the .hex file from years ago)

    SO right now I attaching the code I have so far ...
    I'm just not sure I have the code all correct.
    Do I need to add things like DEFINES to change the default ports.
    I would also like to use the built in clock.This is in my code, please could someone just double check it is correct.

    Here is my code so far, I know it's probably very wrong but it's what I have so far.

    Code:
                OSCCON = $70            'Int CLK 8MHz
    OSCTUNE.6 = 1           'PLL 4x
    ADCON1= %00001111       '$0F = disable A/D converter
    
    TRISA = %00000000       'All pins are outputs
    TRISB = %00000000           
    TRISC = %00000000           
    TRISD = %00000000
    TRISE.0 = 0
    TRISE.1 = 0
    TRISE.2 = 0
    
    DEFINE OSC 32            '4x 8MHz
       Pause 500       ' Wait for LCD to startup
    
    loop1:   
       Lcdout $fe, 1   ' Clear LCD screen
       Lcdout "Hello"  ' Display Hello
       Pause 500       ' Wait .5 second
    
       Lcdout $fe, 1   ' Clear LCD screen
       Lcdout "World"
       Pause 500       ' Wait .5 second
    
       Goto loop1       ' Do it forever
    My pinout are as follows and please see the attached diagram too
    1 VDD VSS
    2 VSS VDD
    3 VEE VEE (10k)
    4 RS 21(PortD.2)
    5 RW VSS
    6 E 22(PortD.3)
    7
    8
    9
    10
    11 D4 27(PortD.4)
    12 D5 28(PortD.5)
    13 D6 29(PortD.6)
    14 D7 30(PortD.7)
    15
    16

    I really would appreciate any help and suggestions.

    Kind regards
    Dennis
    Attached Images Attached Images  

Similar Threads

  1. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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