18f4520 lcd problem


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    14

    Unhappy 18f4520 lcd problem

    Hello, i am a newbie on this and was working on the 18f452. It was going great. I installed an 18f4520 to replace the 18f452 and now the lcd does not work.
    Any help would greatly be appreciated. Can't figure out why.
    I am not using the pro version . On order.

    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
    DEFINE LCD_RWREG PORTA
    DEFINE LCD_RWBIT 2

    ADCON1=$07
    TRISA = $00
    TRISD = $00
    PORTA.2 = 0
    PAUSE 500

    LOOP:
    LCDOUT $FE, 1
    PAUSE 1000
    LCDOUT $FE, $0F
    PAUSE 1000
    LCDOUT $FE, $80,"Hello "
    PAUSE 5000
    LCDOUT $fe, $c0,""
    PAUSE 5000

    GOTO LOOP
    Last edited by merlinknight; - 1st March 2007 at 17:20.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PDF datasheet, page 226, section 19-2 , ADCON1 register

    ADCON1=$0F
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    GREAT! Thank you very much. I kept looking but did not find this.
    I don't understand why its causing the problem though. Looks like none of the pins are analog capable. Using pins RDO - RD6 for LCd display.
    THANKS AGAIN.
    Merlin Knight
    Last edited by merlinknight; - 2nd March 2007 at 03:20.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by merlinknight View Post
    GREAT! Thank you very much. I kept looking but did not find this.
    I don't understand why its causing the problem though. Looks like none of the pins are analog capable. Using pins RDO - RD6 for LCd display.
    THANKS AGAIN.
    Merlin Knight
    None of the Port D pins are analog capable, but the Port A pins (your LCD control) are...
    Have another look at the datasheet...

  5. #5
    Join Date
    Feb 2007
    Posts
    14


    Did you find this post helpful? Yes | No

    Talking

    You are correct. My bad. Thanks again for the help.

    Merlin Knight

Similar Threads

  1. LCD problem with 16F628
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 19th September 2016, 08:28
  2. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07

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