cant get my Lcd to work using Pic18f452


Closed Thread
Results 1 to 14 of 14

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Black square could also mean that the LCD initialization haven't been done properly. Now why... maybe because the LVP mode is still enable, hence RB5 can't be used as a standard I/O. Make sure you disable it in your config fuses.

    The deprecated stuff is just a warning. you can disable it

    @ ERRORLEVEL -230

    in your code or modify the 18F452.inc file in your PBP folder.
    Code:
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F452, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F452.INC"   ; MPASM  Header
            __CONFIG    _CONFIG1H, _OSCS_OFF_1H & _XT_OSC_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
            __CONFIG    _CONFIG4L, _LVP_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	8
    This have been corrected in V2.47.
    Steve

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

  2. #2


    Did you find this post helpful? Yes | No

    Default disableing RB5

    thanks for the info.. one question on that though would it be that i would have to disable it from the trisb ?

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


    Did you find this post helpful? Yes | No

    Default

    Trisb be will set the I/O as an input or output. LCDOUT will automatically do it for you as well, but even with it, if you didn't disable the LVP mode, it will not work.

    Same rules apply with ADC, Comparator etc etc.
    Steve

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

  4. #4


    Did you find this post helpful? Yes | No

    Default follow up

    i could not access the inc file due to access is denied due to school computer. So i tried config 4l by the use of config4l= 0x81

    ; Default settings
    ; ================
    KB_ROW = 4 ; 4 ROW keypad
    KB_ROW_PORT = PORTC ; Keypad ROW on PORTC
    KB_ROW_BIT = 0 ; ROW0 = PORTB.0
    KB_COL = 4 ; 4 COL keypad
    KB_COL_PORT = PORTC ; Keypad Col on PORTC
    KB_COL_BIT = 4 ; COL0 = PORTB.4
    DebounceDelay = d'200' ; debounce delay 200mSec
    CONFIG4L =0x81

  5. #5
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    I had the same problem and it drove me crazy untill I turned the lcd off an noticed for a spit second my message appear. Really look at that contrast pin and make sure you can fade the boxes on and off. This might not be the solution but it was in my case.
    Snap
    Beer is proof that God loves us and wants us to be happy.

  6. #6


    Did you find this post helpful? Yes | No

    Unhappy still having the same issues

    im still trying to get the lcd to work.. i dont know how to configure the lpv to disable and i looked at the contrast and it was fine since i used someones else program using the same pic that im using which is the pic18f452 and it came out working just fine. Im up for anymore ideas or anwsers to solve the problem at hand

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


    Did you find this post helpful? Yes | No

    Default

    Read this, http://www.picbasic.co.uk/forum/showthread.php?t=543 it tells how to set the config fuses from inside the program. As mister_e points out in post #5 of that thread, you could still have problems. If you do it will be time to talk to your instructor.

    Now about the contrast pin. You said that you are using the same PIC as someone else. Do you mean PIC or project board?

    What happens when you adjust the pot tied to the LCD's contrast pin?

    It could be either one, LVP or contrast. If it is the same program as your friend , was your friend using the school's system.

    Let us know.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Could be interesting to have your whole schematic.
    Steve

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

Similar Threads

  1. Pic18f452 with 20x4 LCD Help
    By djmachine in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th November 2008, 22:43
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  4. Why doesn't my code for 18f452 work on 18f252?
    By senojlr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2005, 02:42
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12: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