PICBASIC PRO 16F84 with 16X02 LCD


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Marin, Where is the other side of the pot connected to? It should be between + 5 and ground. Most LCD displays require anywhere between 0 volts and 1 volt for the contrast voltage.

    Dave Purola,
    N8NTA

  2. #2
    Join Date
    Aug 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Dave, thanks for replay!

    I know for that contract....I didn't have pot so i put two 10K resistor in seria and getting contrast V from middle...something about 2,5V!

    Is it this OK?

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Marin,
    Is there more to this code which is unseen?
    You should make it a practice to set your config fuses in code
    and set the TRIS Registers too, also define your OSC speed.
    Are you using a crystal, or resonator or are you trying to use
    the internal osc?
    Code:
    DEFINE OSC 4          ' for 4 mhz osc
    TRISA = %00001111 ' the ones stand for inputs
    TRISB = %00000000  ' the zeros stand for outputs
    Study this thread:
    http://www.picbasic.co.uk/forum/show...iguration+fuse

    Add this just before your first LCDOUT statement to allow the LCD time to initialize:
    Pause 500 ' or a thousand or sometimes a little more

    HTH
    JS
    Last edited by Archangel; - 6th August 2007 at 05:49.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Aug 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    HI Joe! Thanks for replay.....but still I have dead LCD :-(

    That I wrote is whole mine code....this is code now:

    DEFINE OSC 4 ' for 4 mhz osc
    TRISA = %00001111 ' the ones stand for inputs
    TRISB = %00000000 ' the zeros stand for outputs


    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 0
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50


    pause 2500


    LCDOUT $FE, 1, "HELLO"

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Marin, You should use a pot of about 5 or 10 k between +5 and ground as the 2 10k's you have will not get the desired results. When you have the pot installed place it at the 0 volt position and start ramping it up. You will see the background boxes (pixels) start to diminish. This is the optimum contrast level. Read the level with a voltmeter and you will see that it is between 0 and 1 volt.

    Dave Purola,
    N8NTA

  6. #6
    Join Date
    Aug 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    OK, gonna find pot and put it now.....but I saw that nobody comments mine code....do you think is OK now?

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Marin, How can you say that? I see about 2 or 3 comments about your program. Have you tryed any of the suggestions? What were the results? Try what I posted in my last reply and if you can get the display to show darkened block outlines of the character positions and rotating the pot to diminish them then, try your code. You have to get the hardware working before the code......

    Dave Purola,
    N8NTA

Similar Threads

  1. Graphic LCD with PICbasic pro
    By amindzo in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th November 2012, 12:45
  2. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07
  3. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 19:31
  4. Replies: 6
    Last Post: - 4th April 2007, 08:33
  5. Using LCD 40 x 4 with Picbasic pro
    By pcaccia in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th January 2006, 18:31

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