LCD Problem


Closed Thread
Results 1 to 16 of 16

Thread: LCD Problem

  1. #1
    Join Date
    Aug 2005
    Posts
    95

    Default LCD Problem

    I’ve got a 20 line 4 row alphanumeric display wired to a PIC18F252 using the default pins. On line 1 im displaying 20 characters, which displays ok, but the problem is the 13th to the 20th characters from the first line is displaying on line 2.

    Thanks Sphere.


    '-------------------------------------------------------------------------------
    '---------------------------18F252 RUNNING AT 20Mhz-----------------------------
    '-------------------------------------------------------------------------------

    @CONFIG_REQ
    @ __CONFIG _CONFIG7H, _EBTRB_OFF_7H
    @ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
    @ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    @ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
    @ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
    @ __CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    @ __CONFIG _CONFIG3H, _CCP2MX_OFF_3H
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H
    @ __CONFIG _CONFIG2L, _BOR_OFF_2L & _BORV_42_2L & _PWRT_ON_2L
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H




    DEFINE OSC 20
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 4

    adcon1=7

    PAUSE 500
    lcdout $FE,1
    pause 500

    lcdout $FE,$80,"THIS IS A TEST LINE1" 'LINE 1

    MAIN:
    pause 4000
    GOTO MAIN

  2. #2
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    How about this, I believe that the $C0 is the beginning of the second line.




    PAUSE 500
    lcdout $FE,1,"THIS IS A TEST LINE1" 'LINE 1
    pause 500

    lcdout $FE,$C0,"This should be line2"

    MAIN:
    pause 4000
    GOTO MAIN

  3. #3
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default

    This is what shows on lines 1&2 on the display:


    THIS IS A TEST LINE1
    ST LINE1


    Using the lcdout $FE,$C0,"This should be line2" shows on lines 3&4 on the display just like this:

    This should be line2
    be line2


    Ive use other 20x4 lcd displays in the past with no problems.

    Thanks Sphere.
    Last edited by Sphere; - 11th May 2008 at 22:26.

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


    Did you find this post helpful? Yes | No

    Default

    Hi Sphere,
    Here is what I would do to troubleshoot: Change the comment on line 1 so you can tell if
    it is scrambling the comment and printing it or if it is simply printing the last 8 characters
    of line 1 on line 2. It maybe you will have to define commandus and Dataus for this particular LCD
    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.

  5. #5
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default

    Ive altered LCD_COMMANDUS & LCD_DATAUS from one extreme to another and I either get nothing on the display, corrupt display or the same result as before.

    Would wiring all of the data pins on the lcd make a difference or have I just got a duff lcd.


    Thanks Sphere.

  6. #6
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Have you included a defines list like below?
    Note the lines define in the 10th line should be for 4 lines

    Define LCD_DREG PORTb ' Port for LCD Data
    Define LCD_DBIT 4 ' Use upper 4 bits of Port
    Define LCD_RSREG PORTb ' Port for RegisterSelect (RS) bit
    Define LCD_RSBIT 0 ' Port Pin for RS bit
    Define LCD_EREG PORTb ' Port for Enable (E) bit
    Define LCD_EBIT 2 ' Port Pin for E bit
    DEFINE LCD_RWREG PORTb 'port for the R/W bit
    DEFINE LCD_RWBIT 1 'port pin for R/W bit
    Define LCD_BITS 2 ' Using 4-bit bus
    Define LCD_LINES 4 ' Using 4 line Display **************************
    Define LCD_COMMANDUS 2000 ' Command Delay (uS)
    Define LCD_DATAUS 50 ' Data Delay (uS)
    Peter Moritz.
    Up the bush, Western Plains,
    New South Wales,
    Australia.

  7. #7
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default

    Tried adding the defines but no joy, still the same result. Ill just wire all the data pins up and see if that works. If no joy ill just resign it to the scrap bin of life.

    Thanks all Sphere.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sphere View Post
    Ive altered LCD_COMMANDUS & LCD_DATAUS from one extreme to another and I either get nothing on the display, corrupt display or the same result as before.
    Keep in mind that LCD_DATAUS is a byte value. Max is 255. 256 would be treated just like a 0. LCD_COMMANDUS is still a word value.

    Would wiring all of the data pins on the lcd make a difference or have I just got a duff lcd.
    Of course wiring would make a difference.
    Looks to me like you've got some crossed wires and/or solder joints.

  9. #9
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default

    Wired all data lines but still have the same issue, but it looks like it treats lines 1 & 2 as line one and lines 3 & 4 as line two. Is there any limitation in picbasic pro's lcdout command for this type of display. The display type is Batron BTHQ42003AV, ive ordered a replacement anyway just in case this one is faulty.

    Thanks Sphere.
    Last edited by Sphere; - 14th May 2008 at 22:41.

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sphere View Post
    Wired all data lines but still have the same issue, but it looks like it treats lines 1 & 2 as line one and lines 3 & 4 as line two. Is there any limitation in picbasic pro's lcdout command for this type of display. The display type is Batron BTHQ42003AV, ive ordered a replacement anyway just in case this one is faulty.
    Would've been a lot more helpful to have the model information a lot earlier.
    The model you've got has a controller that isn't 100% Hitachi 44780 compatible.
    Seems it likes to work in blocks of 12...which would probably explain your issues.
    In the case of this LCD, the standard 1st line ($80), 2nd line ($C0), 3rd line ($94), 4th line ($D4) addresses aren't going to work.
    Here's the link to the datasheet:
    http://www.datasheetcatalog.com/data...6712UA02.shtml
    Read thru it a bit. You may/may not see what I mean...specifically page 364, 384, and 419.
    Last edited by skimask; - 14th May 2008 at 23:37.

  11. #11
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default

    Is the display not compatable with pic basic and do you know what the EXT pin is.

    Thanks Sphere.

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sphere View Post
    Is the display not compatable with pic basic and do you know what the EXT pin is.

    Thanks Sphere.
    I'd say it's 'compatible enough', it just needs different parameters than what the PBP manual calls for.
    From the quick read I did of that datasheet (the rest is up to you), it looks to me like the left 12 characters can be accessed normally, like it was a regular 12x4 display. But to get to the right 8 characters, you have to use that pin in some way.
    It's either that or write your own routines to handle the display...

  13. #13
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default

    Thanks for trying, I guess I will have to find an alternative display. If anyone out their can help with an alternative display which is compatible with pic basic but also has the same dimensions as the display I quoted it would be appreciated.

    Thanks again skimask for the extended effort.

    Sphere.

  14. #14
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sphere View Post
    Thanks for trying, I guess I will have to find an alternative display. If anyone out their can help with an alternative display which is compatible with pic basic but also has the same dimensions as the display I quoted it would be appreciated.
    I don't think you need a different LCD. A little bit of reading will most likely get this LCD working for you just fine.

  15. #15
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi,

    it appears the "extention driver" must be enabled for character > 12 th column ...

    solution is in the KS 0073 Datasheet, page 27 bottom ...

    Good reading

    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    The HD66712 software is upwardly compatible with the LCDII (HD44780) which allows the user to
    easily replace an LCD-II with an HD66712. In
    it's compatible... hardware problem...
    Steve

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

Similar Threads

  1. LCD problem with 16F628
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 19th September 2016, 08:28
  2. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  3. LCD problem
    By Andre_Pretorius in forum General
    Replies: 8
    Last Post: - 27th January 2009, 15:47
  4. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07

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