Serial LCD problem


Closed Thread
Results 1 to 38 of 38

Hybrid View

  1. #1
    mind's Avatar
    mind Guest

    Default Serial LCD problem

    Hi guys

    I am posting this here, after going nuts trying to figure it out myself (repeatedly) and much googling with no luck.

    I have a PIC16F88 and a 2 x 16 serial LCD using a ST7036 Sitronix controller. The controller is HD44780 compatible. The display remains blank (ie: nothing happens).

    The code is as follows:
    Code:
        INCLUDE "modedefs.bas"
        DEFINE OSC 4
        DEFINE CHAR_PACING 1000
    @   DEVICE  PIC16F88, INTRC_OSC_CLKOUT, WDT_OFF, PWRT_ON, BOD_OFF, MCLR_OFF, PROTECT_OFF
        osccon = %01101110
        sspcon = %00110001
        trisb  = %00000000
        disable interrupt
        pause 500   ' wait for LCD to startup
        
        LCD_ChipSelect var portb.0
        LCD_CommandLow VAR portb.1
        LCD_SerialIn VAR portb.2
        LCD_Clock VAR portb.4
    
        Symbol LCDMode = N1200
        
        HIGH LCD_ChipSelect                          '  select LCD on SPI bus
        LOW LCD_CommandLow                       ' select command mode
        Serout LCD_SerialIn, LCDMode, [$38]     ' function set
        pause 50
        Serout LCD_SerialIn, LCDMode, [$39]     ' function set
        pause 50
        Serout LCD_SerialIn, LCDMode, [$14]     ' bias
        pause 50
        Serout LCD_SerialIn, LCDMode, [$78]     ' contrast set
        pause 50
        Serout LCD_SerialIn, LCDMode, [$5E]     ' contrast control
        pause 50
        Serout LCD_SerialIn, LCDMode, [$6E]     ' follower control
        pause 200
    
        Serout LCD_SerialIn, LCDMode, [$0C]     ' display on
        pause 50
        Serout LCD_SerialIn, LCDMode, [$01]     ' clear display
        pause 50
        Serout LCD_SerialIn, LCDMode, [$06]     ' entry mode right
        pause 50
    
        HIGH LCD_CommandLow   ' data mode
        
    loop:
        Serout LCD_SerialIn, LCDMode, ["Hello world"]
        Pause 500	' Wait .5 second
        Goto loop	' Do it forever
    So, since this is my first ever LCD project, I have probably made a bunch of assumptions which have gotten me into trouble. Any criticism or pointers would be much appreciated.

    Best regards
    Richard

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    You need to send a DEC val of 13 to turn on the LCD.
    From there, you can send ascii data.

    I am not familiar with your "Serial LCD", and am not sure how it is set up to communicate. But it will need the DEC value of 13 before it will turn on.

    Psuedo Code

    Command pin = on
    serout pin,13
    Command pin = off
    serout pin,"Hello World"
    end

    Dwayne
    Last edited by Dwayne; - 2nd August 2005 at 14:41.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi there

    Well, I have the line:
    Serout LCD_SerialIn, LCDMode, [$0C] ' display on

    Since the spec defines it as : 00001DCB
    where:
    D = display on
    C = cursor on
    B = Cursor blink on

    So, $0C = 0000 1100 = display on, no cursor, no blink

    Your suggestion of needing to pass it "13" is 1101, ie: display on, no cursor, blink on.

    Any other thoughts on what to look for, would be appreciated !

    -Bye
    -Richard
    ps: yes, I did try your suggestion too ! ... no luck

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Then I would check your contrast....Put a 10k center tap pot with contrast pin of LCD in the middle, and connect the ends of the pot to +/-. ADjust pot until you see black squares...

    If you cannot see them with a command 13, then I would start questioning your LCD, whether it is good or not.

    When you say "Serial" LCD, you are talking about ONLY 3 wires going to it, right???? 1. - data 2- Positive 3 - ground.

    If this is so, you may have to check your manual to the SERIAL LCD, and see how to "Turn it on".

    One other point... SCOPE your pic chip!!! make sure you can see your data being sent !

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  5. #5
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Dwayne

    Serial LCD is only a little more complicated
    Data, clock, Vdd, Vss, command select pin (command/data mode), chip select pin (so multiple chips can share the SPI interface).

    So, yes, contrast is done in software. The manual says exactly what I quoted in my previous post about which bits to send to turn it on.

    And I wish I did have a scope... Time to schmoose some of my EE friends who do have scopes !

    It is possible that I am not outputting clock signal or something (but I checked with a LED, and it does light up!).

    Best regards
    Richard

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Mind,

    I have never used one of these displays,
    but a quick glance at the datasheet makes me feel the serial interface is I2C or SPI, not asynchronous.

    So it won't work using SEROUT.

    pressuming you have the controller configured and wired up correctly
    use SHIFTOUT or I2CWRITE.
    (Dependend on the controllers config)
    Last edited by NavMicroSystems; - 2nd August 2005 at 15:43.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi

    Yes, it is meant to be an SPI interface. I had assumed SPI = serial, and therefore I should use SEROUT.

    I have made the changes, but still no luck

    Best regards
    Richard

  8. #8
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mind
    Hi

    Yes, it is meant to be an SPI interface. I had assumed SPI = serial, and therefore I should use SEROUT.

    I have made the changes, but still no luck

    Best regards
    Richard
    Richard,

    could you post the changed code?
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  9. #9
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Mind,

    Mind>>Serial LCD is only a little more complicated
    Data, clock, Vdd, Vss, command select pin (command/data mode), chip select pin (so multiple chips can share the SPI interface).<<

    I have used both SERIAL, 4 bit and 8 bit buss LCD's. Complicated? I have designed my own Serial controlled LCD's, used on my Instrument panel of my Experiemental. <g>. Granted, there are many things I do not know. But I can only give you generic data on a controller that you said was compatible to the HD44780. How that data is fed to the LCD is up to the person who designed it.

    Ralph I see responded to you... He is top notch...Same with STeve, Melanie, Bruce, and Darrel. They work with it on a daily basis for their work.

    Mind>>So, yes, contrast is done in software. The manual says exactly what I quoted in my previous post about which bits to send to turn it on.

    And I wish I did have a scope... Time to schmoose some of my EE friends who do have scopes !<<

    That can help out a lot! It can get rid of the "Gotcha" and things that SHOULD be working... and you find out they are not working.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  10. #10
    faital's Avatar
    faital Guest


    Did you find this post helpful? Yes | No

    Default

    Hi, This post is very informative, however I would like some specific information. If someone can help me then please send me a private message. Best Regards,

    faital - If your post is genuine then somebody just might PM you (unlikely with your request), but if not, rest happy that your thinly veiled website adverts didn't even last 20 minutes, probably only noticed by one or two people (your bad luck one of them was me!) and took far less time to kill than you took to create! Melanie

  11. #11
    livin4th's Avatar
    livin4th Guest


    Did you find this post helpful? Yes | No

    Default SPI initialization help fpr dogm162

    i have read the posts made in the thread and i am trying ti get the same display to start using SPI interface.after successfully interfacing the display to board and sending the correct data sequence to the display from the MOSI pin(checked in scope), the display is still dead.I am confused as to what might be the problem during initialization.

    the data i sent from spi MOSI is using standard SPI function for the board SPI_I2S_SendData(SPI2, byte);

    the byte is transmitted successfully.but the lcd doesnt start.

    in the LCD part of the code is it necessary to do any coding prior to the initialization like addressing registers and all?i just started sending commands through MOSI to SI pin of display.should i do some coding for shifting the registers in display for data? am i doing something wrong?

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. LCD serial backpacks
    By Archangel in forum Serial
    Replies: 67
    Last Post: - 30th December 2010, 04:51
  3. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  4. Please help with EDE702 - Serial to LCD interface
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th October 2008, 02:48
  5. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43

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