Stupid question about LCDOUT


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80

    Default Stupid question about LCDOUT

    Well, since I got some help from you guys with my servoproblems I now have a more or less working routine for that, well, now I wanted to have a LCD to put some debug data to, reading the PBP manual it looks so easy, so I started with building the example in PBP manual:

    http://www.melabs.com/resources/pbpm...2-5_35.htm#535

    The only change I did was using a 16F628A instead of the 16F84A, therefore I removed the xtal and the two caps.

    Then I wrote a very small program like this:

    Code:
    @ device INTRC_OSC_NOCLKOUT,MCLR_OFF,LVP_OFF,WDT_OFF,PROTECT_OFF
    DEFINE OSC 4	' Lets work at 4MHz
    CMCON = 7        ' Disable comparators
    
    pause 500          ' grace time for the LCD to initialize.
    
    main:
    	LCDOUT $FE, 1, "Hello world" ' Clear display and show text
    	pause 1000		          ' Wait 1s
    	goto main			   ' Go back
    Well, nothing happens.. no sign of text on the LCD, no matter how I adjust the pot.. and I cant see why ?

    The LCD is a Sharp LM16A211, which is Hitachi 44780 compatible, and I also have used several of these for other applications so they are ok.

  2. #2
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA.
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Hi Glenn,

    I believe that you also need the Defines shown in the MELabs manual, before you use the LCDOUT command.

    Good Luck,

    Jerry
    If your oscilloscope costs more than your car...

  3. #3
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    Well, if I understand it correctky its not needed if you use the default stuff, but I tried to add the whole define-block mention in the manual, and there is no difference.

    I also tried to put a LED on a pin and make it flash so I know that the pic is "running"..

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Glenn View Post
    The only change I did was using a 16F628A instead of the 16F84A, therefore I removed the xtal and the two caps.
    Got a pullup on RA4?
    Try putting the xtal and the caps back on there anyways? Just in case the config fuses didn't take.
    Put an LED on an unused pin for grins and see if it blinks for ya... I ALWAYS use a heartbeat LED or two on all my projects. It takes sooo much guesswork out of the equation...

    Code:
    @ device INTRC_OSC_NOCLKOUT,MCLR_OFF,LVP_OFF,WDT_OFF,PROTECT_OFF
    DEFINE OSC 4	' Lets work at 4MHz
    CMCON = 7        ' Disable comparators
    pause 500          ' grace time for the LCD to initialize.
    led var portb.0
    main: led = 1 
            LCDOUT $FE, 1, "Hello world" ' Clear display and show text
    	pause 500		          ' Wait 1/2 sec
            led = 0
            LCDOUT $FE, 1, LED Off"
            pause 500
            goto main			   ' Go back

  5. #5
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Got a pullup on RA4?
    Yes, I accidenticaly made it a pulldown first, but when it didnt work I checked all connections and fixed that.

    Try putting the xtal and the caps back on there anyways? Just in case the config fuses didn't take.
    Put an LED on an unused pin for grins and see if it blinks for ya... I ALWAYS use a heartbeat LED or two on all my projects. It takes sooo much guesswork out of the equation...
    As I wrote I already did that ..I also like the idea with a heartbeat (Even if it doesnt look as nice at it does on my old HP PA-RISC machine if I have a spare pin.

    It flashes so the oscillator doesnt seem to be the problem.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Glenn View Post
    Well, since I got some help from you guys with my servoproblems I now have a more or less working routine for that, well, now I wanted to have a LCD to put some debug data to, reading the PBP manual it looks so easy, so I started with building the example in PBP manual:

    http://www.melabs.com/resources/pbpm...2-5_35.htm#535

    The only change I did was using a 16F628A instead of the 16F84A, therefore I removed the xtal and the two caps.

    Then I wrote a very small program like this:

    Code:
    @ device INTRC_OSC_NOCLKOUT,MCLR_OFF,LVP_OFF,WDT_OFF,PROTECT_OFF
    DEFINE OSC 4	' Lets work at 4MHz
    CMCON = 7        ' Disable comparators
    
    pause 500          ' grace time for the LCD to initialize.
    
    main:
    	LCDOUT $FE, 1, "Hello world" ' Clear display and show text
    	pause 1000		          ' Wait 1s
    	goto main			   ' Go back
    Well, nothing happens.. no sign of text on the LCD, no matter how I adjust the pot.. and I cant see why ?

    The LCD is a Sharp LM16A211, which is Hitachi 44780 compatible, and I also have used several of these for other applications so they are ok.
    try this
    Code:
    @ DEVICE INTRC_OSC_NOCLKOUT,MCLR_OFF,LVP_OFF,WDT_OFF,PROTECT_OFF
    DEFINE  LCD_COMMANDUS 1000 'Defines how fast PIC sends Data and 
    '                          'Commands to LCD change to suit LCD's 
    '                          'needs. 
    DEFINE LCD_DATAUS 50	     'Define delay time between sending LCD
                               'commands.
                               'Define delay time between data sent.
    DEFINE OSC 4	' Lets work at 4MHz
    CMCON = 7        ' Disable comparators
    
    pause 500          ' grace time for the LCD to initialize.
    
    main:
    	LCDOUT $FE, 1 ' CLEAR LCD
            PAUSE 10
            LCDOUT $FE,2, "Hello world" ' LINE 1 and show text
    	pause 1000		          ' Wait 1s
    	goto main			   ' Go back
    END
    I'm not sure about the config statement as I do not use PM assembler anymore
    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.

  7. #7
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    try this
    No, didnt work either

    ..I think I going to try to dig some 16F84A's up and try with that instead, since the example is made for 16F84.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi,

    Did you notice the reversed pinout numbering ??? ... from right to left.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,
    Did you notice the reversed pinout numbering ??? ... from right to left.
    Yes, I have the datasheet for the displays since I used them in aother project (connetced to the parport of a computer)

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Glenn View Post
    Yes, I have the datasheet for the displays since I used them in aother project (connetced to the parport of a computer)
    Using one of those 'solderless breadboards' for the project?
    Double check those connections!!! They might be hooked up right, but are they making contact...

  11. #11
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    Ok, no I changed the pic to a 16F84A, and connetced a Xtal and two caps, still doesnt work

    Very strange.

    Now I test with:

    Code:
    @ device HS_OSC,WDT_OFF,PROTECT_OFF
    DEFINE OSC 4	' Lets work at 4MHz
    
    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 500 ' grace time for the LCD to initialize.
    
    main:
    	LCDOUT $FE, 1, "Hello world" ' Clear display and show text
    	high portb.0	' Turn the LED on.
    	pause 1000	' Wait 1s
    	low portb.0	' Turn the LED off.
    	pause 1000	' Wait 1s
    	goto main	' Go back

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  2. need help in coding..
    By daphne8888 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 19th March 2008, 07:31
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  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