LCDOut Woes


Closed Thread
Results 1 to 13 of 13

Thread: LCDOut Woes

  1. #1
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9

    Talking LCDOut Woes

    Hi guys,

    Ok, I am at my wits end. I've come back to Pic and Picbasic pro from AVR so I can rapidly develop some basic circuits I need for the homestead. I spent two days working on two simple (well should be) circuits and cannot seem to get anything working except PWM on 16F628.

    I wanted to make a turns counter using a hall effect and LCD connected to a 16F628. I have an old LCD backpack but it just sends garbage to the lcd as if the controller on it has been zapped by static or something.

    So I fired up one of the many new LCD's I have and using LCDOUT I still cannot get anything working. I set up the 16F628 and made sure three or four of them were working on the test board and all were fine and could output PWM on CCP1 etc, but no LCD even after hours of checking and rechecking connections and filtering power etc. It's got to be coding issues. Don't laugh too hard, I have not written in basic in years now

    Here is the circuit I am using and code:

    @ DEVICE PIC16F628, INTRC_OSC_NOCLKOUT, WDT_ON, MCLR_OFF,BOD_ON, LVP_OFF, CPD_OFF, PROTECT_OFF

    DEFINE OSC 4


    TRISA = %00011111
    TRISB = %00001000
    CMCON = 7 ' PortA = digital I/O


    begin:
    pause 1000
    LCDOUT $FE,1,"Testing...."
    pause 1000
    LCDOUT $FE,1
    goto begin
    Attached Images Attached Images  

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Blocks on the LCD, yes/no?
    Contrast dialed both one way (to Vdd) and back (to Vss), any changes in the screen?
    Put a 'heartbeat' LED on the board, make sure the thing is actually running...

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


    Did you find this post helpful? Yes | No

    Default

    I may not be looking at it correctly and I think LCDOUT over rides it???
    The TRISA posted has your LCD pins set for input?
    Dave
    Always wear safety glasses while programming.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    The TRISA posted has your LCD pins set for input?
    I'm fairly sure LCDOUT does override it. (otherwise there'd probably be another million threads on the forums about why this or that doesn't work right here or there)

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


    Did you find this post helpful? Yes | No

    Default

    I see no LCD defines in your code... please put them in.

    They are in the PICBASIC manual and tons of examples on this forum. Set them up for the way you've got your LCD wired.

  6. #6
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    I see no LCD defines in your code... please put them in.

    They are in the PICBASIC manual and tons of examples on this forum. Set them up for the way you've got your LCD wired.

    Yes, contrast works on three different (brand new) LCD's. All LCD defines are now at default which is:

    PORTA.0 =Data bit 4
    PORTA.1=Data bit 5
    PORTA.2=Data bit 6
    PORTA.3=Data bit 7
    PORTA.4=R/S
    PORTB.3=Enable
    R/W is grounded

    I Disabled MCLR to eliminate the need for pull-up and hassle. I also tried TRISA=%00000000 and TRISB=%00000000. I will post anything you need. Pictures, or anything else. I can even switch to a breadboard and eliminate possibility of circuit board issues (proto board) although I have spent literally 20 hours soldering and de-soldering an looking at every little solder joint, then using PWM and other commands to make sure the chips are good and working properly.

    Thanks for your help on this. Very, very much appreciated...
    Last edited by LetTheSmokeOut; - 7th June 2008 at 07:21.

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


    Did you find this post helpful? Yes | No

    Default

    Melanie is asking to see the part of your code that looks something like this;
    Code:
    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
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Melanie is asking to see the part of your code that looks something like this;
    Code:
    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
    Yes indeed. I am using the defaults explained in the PicBasicPro manual. It states that you don't need any defines if you are going to accept the defaults which are what I stated above. Is this not the case? I've used the program with LCD defines and without, but I can put them back into the program just to make sure. I have also used defines for a different pin setup that allowed PORTB.3 to be used as PWM output while the other pins ran the LCD.

  9. #9
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    This should be what I have setup at the moment:

    (CODE)
    DEFINE LCD_DREG PORTA
    define LCD_DBIT 4
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 1
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50
    (/CODE)

  10. #10
    Join Date
    Apr 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    try using with the configuration bits as watchdog timer off and brown out detect off, power up timer on and oscillator as XT

  11. #11
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by abidr View Post
    try using with the configuration bits as watchdog timer off and brown out detect off, power up timer on and oscillator as XT
    Ok thanks I will try that. I am still working on it. I wound one coil by keeping track of counts in memory and I already have problems, I missed about 30 turns out of 900 lol! My backpack LCD (Seetron) was purchased back in 1999 and I found it works but the 16C54 it uses is bad (sends out garbage on the 3rd character placement and further) so I will have to get back on the LCDout unit using 16F628.

    I will try this tomorrow and get back to you. Thanks very much for the input it is very much appreciated.

  12. #12
    Join Date
    Dec 2005
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    Hey LetTheSmokeOut,
    I'm still pretty newbie to this stuff, but I had 2 issues that drove me nuts for a while that you never kbnow, could be one of your problems. One was that, for some reason, no matter how many times I read the PBP manual for the LCDOUT command, my mind never saw the "Flags = 0" part. Some one here pointed that out to me and that fixed one issue. The other issue was that I was getting garbage displayed sometimes and I could not display a number ending in "0" or "P". It turns out that the voltage rating fro the LCD was a minimum of 4.7 V and with the resistor I was using, it was about 4.62 or so. I changed that resistor to get the voltage up in range and that solve my bizarre problems.
    Gary

  13. #13
    Join Date
    Jun 2008
    Location
    Arizona
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Thanks guys. It's working now. Looks like the fuse settings as Abidr mentioned was one problem and the flags=0 like G-hoot mentioned was another. Thanks for all your help!

    Now I have to figure out interrupts so I can use a Hall effect to send RB0 high on my coil winder so I can increment W0 based on a pulse from the hall and output the word to LCD = )

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 : 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