4-Line LCD and 18F4620


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1

    Default 4-Line LCD and 18F4620

    I moved from a 16F877 to a 18F4620 and can't get the latter to work. The 877 programs in 4 or 8 bit modes and is 100%. The 4620 shows only 2 lines all blanked dark. The only difference between the two codes is the config setup since the 4620 has to use the MPASM for assembly. I ran a blink test with the current config settings and it was OK. I have tried 4-bit and 8-bit modes, same result. The 4620 is the same pinout as the 877 except the 4620 has a couple of pins multiplexed for other uses. Is there something simple I am overlooking?

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


    Did you find this post helpful? Yes | No

    Default

    With out more info the contrast pin on the LCD needs looked at.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Works for me with a 18F4620


    DEFINE LCD_LINES 4
    define LCD_DREG PORTD
    DEFINE LCD_RSREG PORTC
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTC
    DEFINE LCD_EBIT 2

    You may need to change this according to actual pins used. Would be easier to get more help if you post (at least) the defines your actually using.


    J-P

  4. #4


    Did you find this post helpful? Yes | No

    Default Lcd/4620

    Here are the DEFINES for the 4620

    DEFINE OSC 4 'OSC IS 4Mhz.
    DEFINE LCD_DREG PORTB 'DATA BUS IS DB4,DB5,DB6,DB7 = RB4,RB5,RB6,RB7
    DEFINE LCD_DBIT 4 'STARTING BIT IS RB4, PIN #37
    DEFINE LCD_RSREG PORTA 'REGISTER SELECT PORT IS PORTA
    DEFINE LCD_RSBIT 0 'REGISTER SELECT BIT IS RA0,PIN #2
    DEFINE LCD_EREG PORTD 'LCD ENABLE PORT IS PORTD
    DEFINE LCD_EBIT 2 'LCD ENABLE BIT IS RD2,PIN #21
    DEFINE LCD_BITS 4 'TOTAL DATA BUS WIDTH IS FOUR BITS
    DEFINE LCD_LINES 4 'TOTAL LINES OF LCD IS FOUR
    DEFINE LCD_COMMANDUS 2000 'COMMAND DELAY TIME IN MICROSECONDS
    DEFINE LCD_DATAUS 50 'DATA DELAY TIME IN MICROSECO

    I have tried other port combinations with the same results.
    First off, sorry for posting in the wrong area. Let me back up to the 877 which was 100% perfect untill I tried to change the ENABLE port and ran into this error:INTERNAL[402]ATTEMPT TO POP EMPTY SYMBOL TABLE STACK. Don't know what is going on here? I tried another code for a 16F628 which was a simple and sound blink routine and got the same error. I thought I would post first before trying a restart and checking the MCS site for error codes. Nothing is simple in micro land.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The only difference between the two codes is the config setup
    This would be part of the problem at least. The 18F4620 has A/D inputs on several
    port pins you're using to control the LCD.

    RB4 is AN11. RA0 is AN0. ADCON1 = 15 disables A/D so you can use these pins for
    digital I/O.

    I've never seen the internal 402 error, but a re-install should take care of it.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Default error status/locked

    Tried a reinstall , uninstall and install same-o, same-o. The question I have is: Is error 402 a lock up event meaning the programmer is bad and will need replacement. I hope MeLabs likes me. I will try turning off the comparators later. A positive side of all this is I had time to learn more about the drawing program in Eagle.

Similar Threads

  1. Interrupt RPM and Taylors Elapsed time on 18F4620
    By Tobias in forum mel PIC BASIC Pro
    Replies: 70
    Last Post: - 3rd February 2010, 16:12
  2. 18F4620 and SHT11 problems
    By wjsmarine in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th June 2009, 10:26
  3. 16F877 upgrade to 18F4620
    By earltyso in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th January 2008, 06:28
  4. Need help to get I2CRead woriking
    By w7ami in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th November 2007, 16:22

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