Serial LCD problem


Closed Thread
Results 1 to 38 of 38
  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
    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...

  9. #9
    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 ...
    _______________________________________________



  10. #10
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Heya

    Here is the code at the moment, after changes:

    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 mode = 5   ' tried mode 4 too
        
        HIGH LCD_ChipSelect
        LOW LCD_CommandLow
        shiftout LCD_SerialIn, LCD_Clock, mode, [$38]  ' function set
        pause 50
        shiftout LCD_SerialIn, LCD_Clock, mode, [$39]  ' function set
        pause 50
        shiftout LCD_SerialIn, LCD_Clock, mode, [$14]     ' bias
        pause 50
        shiftout LCD_SerialIn, LCD_Clock, mode,  [$78]     ' contrast set
        pause 50
        shiftout LCD_SerialIn, LCD_Clock, mode, [$5E]     ' contrast control
        pause 50
        shiftout LCD_SerialIn, LCD_Clock, mode,  [$6E]     ' follower control
        pause 200
    
        shiftout LCD_SerialIn, LCD_Clock, mode, [%00001111] ' display, cursor, blink all on
        pause 50
        shiftout LCD_SerialIn, LCD_Clock, mode, [$01]   ' clear display
        pause 50
    
        HIGH LCD_CommandLow
        
    loop:
        shiftout LCD_SerialIn, LCD_Clock, mode, ["Hello world"]
        Pause 500	' Wait .5 second
        Goto loop	' Do it forever
    Best regards
    Richard

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


    Did you find this post helpful? Yes | No

    Default

    Richard,

    I'm sorry I have to say this, but I'm not going to study the entire Datasheet for you.

    Here are some hints:

    - ChipSelect is active LOW, not HIGH
    - Data is sent MSB first with clock Idling HIGH --> Mode 5
    - Set OSCON according to your clock source and speed ($60 for 4MHz INTRC)

    Your schematic would also help to analyze the problem.
    regards

    Ralph

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



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


    Did you find this post helpful? Yes | No

    Default

    Hello Richard,

    I still do not see a 13 being passed to your LCD in your code...

    Comment out all the wacky stuff....ALL of it....

    Send just the 13 and Hello world.

    I think you are bitin off more than you can chew all at once my friend.

    Make sure you have a pause 500 (1/2 second delay to make sure the LCD is turn on and "warmed up" (as I call it).

    A 1/2 second pause before you send the 13, and a 1/2 second pause after you send the 13... then send Hello world.

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

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


    Did you find this post helpful? Yes | No

    Default

    Dwayne,

    thanks for trying to help,
    but at the moment there are other problems that "13"

    You can send as many "13's" as you want,
    if the Controller is never selected it will just do nothing!
    regards

    Ralph

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



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


    Did you find this post helpful? Yes | No

    Default

    Hello Richard,

    You made a comment, that this is your first project...

    One projects as such, it is best to go the very BASICS of everything. Do not add bells and whistles *until* you get the crazy thing working. You said it was HD44780 compatible...

    Sending a Dec 13 will turn on the display and allow you to print ascii to it. This should be your main concern... NOT whether it blinks, does whistles, changes lines, smokes cigarettes for you, or drinks beer. 8-}

    AFter you get just those two things to work.. THEN experiement with one added command at a time....

    You are slowly eliminating variables... one at a time... instead of trying to elminate 15 variables... in which one of those 15 could be what you really need!

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

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


    Did you find this post helpful? Yes | No

    Default

    DWAYNE,

    PLEASE...
    regards

    Ralph

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



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


    Did you find this post helpful? Yes | No

    Default

    Hello Ralph,

    thanks for trying to help,
    but at the moment there are other problems that "13"

    You can send as many "13's" as you want,
    if the Controller is never selected it will just do nothing!
    Gosh you ought to be proud of me remembering to "Quote" <chuckle>

    I agree with you... I sent another message... I just see so many "Variables" he is trying to play with...When he should only be concerned with one Variable...Turning it on. And possibly another... Writing "Hello" to it to verify that it is turned on.

    I have not used the Shiftout method... you did a splinded job on seeing that in the Data sheet. I can only assume he knows how to write to the controller... (how ever that is)... LIke you said before(which I agree)... I am not going to read the manual of a LCD that I don't care to use... But you and I both know what it takes to "tickle" that LCD to make it write ASCII...

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

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Dwayne
    Hello Ralph,
    Gosh you ought to be proud of me remembering to "Quote" <chuckle>
    I am proud, but now let's get back to the topic and focus on solving the problem.

    (We don't want this thread to end up with a 3 three figures number of posts and 80% of them being off topic.)
    Last edited by NavMicroSystems; - 2nd August 2005 at 17:23.
    regards

    Ralph

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



  18. #18
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph

    Thanks for the reply, and catching my inverted chip select level.

    I already had mode 5 in my code, and 4MHz as my clock speed (line 5), so yes, I have read the data sheets, but since I am a ME, rather than EE, there could be something that I am missing. I figured it would be obvious to someone with experience

    Best reagrds
    Richard

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


    Did you find this post helpful? Yes | No

    Default

    Richard,

    are you saying it's working now?
    regards

    Ralph

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



  20. #20
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph,

    Nope...

    Best regards
    Richard

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


    Did you find this post helpful? Yes | No

    Default

    Richard,
    could you post a schematic?
    (just the connections between the PIC and LCD)
    Last edited by NavMicroSystems; - 2nd August 2005 at 18:08.
    regards

    Ralph

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



  22. #22
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph,

    Sorry, but I don't really have the tools to do a quick schematic.

    I have the PIC + LCD + Voltage regulator on a breadboard at the moment.

    The lines are as follows:
    data: pin portb.2 --> LCD data pin
    clock: pin portb.4 --> LCD clock pin
    chip select: pint portb.0 --> LCD CSB pin (LOW = selected)
    command: pin portb.1 --> LCD RS pin (LOW = command, high = data)

    The voltage regulator is a ultra-low dropout 5V +/- 0.025V and can supply
    enough current. It has tant caps on both sides of it of the correct size, and has been used for other projects.

    The LCD backlight is not connected (it is actually a seperate part), and the LCD uses 0.25mA when powered according to the spec sheet.

    Best regards
    Richard

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


    Did you find this post helpful? Yes | No

    Default

    Richard,

    that looks good so far.

    How about the other pins on the LCD controller?
    regards

    Ralph

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



  24. #24
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph

    The other pins are tied to either GND, or 5V as per the circuit drawing that comes with the LCD. The LCD pdf can be downloaded here:
    http://www.lcd-module.de/eng/pdf/doma/dog-me.pdf

    I am using 5V, SPI interface, as every other pin on the PIC will be used (eventaully). At the moment, the extra PIC pins are not connected.

    Best regards
    Richard

  25. #25
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Sorry to butt-in here, but I noticed a few things that might cause you problems.

    Change OSCCON = %01101110 to OSCCON = %01101100. This jives with your particular oscillator configuration.

    You're writing to SSPCON configuring it for "SPI Master", but you're not using this hardware with shiftin/shiftout. Don't setup SPI hardware if you don't use it. This affects RB1, RB2, and RB4.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  26. #26
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Bruce

    I was originally using SEROUT, but then it was pointed out that for SPI mode, I should be using SHIFTOUT. I have since corrected it, and resposted the code.

    Later, I will attach a A/D on the SPI bus, so it is important to get these things right !

    Best regards
    Richard

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


    Did you find this post helpful? Yes | No

    Default

    Richard,

    Bruce is absolutely right regarding the OSCCON and SSPCON settings.

    The latest code you have posted still contains incorrect values.

    (I had mentioned OSCCON earlier)

    I'm not sure if writing to SSPCON would have any negative effect, but as you are not using the MSSP module it doesn't help either, so just remove that line.

    To help any further I would have to have a closer look to the datasheet.
    (I will when I find time to)

    P.S.
    There is one more thing you could try:

    run some loops that set "contrast" and "bias" vlaues from $00 to $FF

    at some point "black boxes" should appear on the LCD.
    regards

    Ralph

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



  28. #28
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph

    Checking the forums before sleep huh ? Heheh

    Good suggestions about running loops. Will add fixes, and try it out, and see.

    I still think it is something stupid I am missing ......

    Best regards
    Richard

  29. #29
    G8RPI's Avatar
    G8RPI Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I hate to butt into a long thread - but,
    This module will also work in the "normal" 4 or 8 bit parallel mode, why don't you try usinging it in 4 bit parallel mode with the standard LCDOUT command?
    This would prove that the basic display is working OK. SPI is like RS232 in that it's a standard with many variables. It's not the best choice for your first project, especially with a device that has not been used with PBP before (as far as we know).

    HTH Robert.

  30. #30
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi guys

    Okay, so I hooked up the display in 4bit mode, and it works fine.

    Unfortunately, I need to use it with a SPI connection which will be shared with an A/D. Going to a bigger device is not an option for various reasons.

    So, if I want to be using SPI, should I be using SEROUT, or SHIFTOUT ?

    I basically have 3 pins on the LCD. SerialIn, Clock, and RegisterSelect (we can hold ChipSelect low, since the LCD is the only SPI device on the breadboard at the moment). How hard can it really be ? Its meant to be BASIC !

    Best regards
    Richard

  31. #31
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Smile Serial LCD solved

    Hi guys

    Solved the problem. It really is simple, once you look at it. Did this with a PIC16F88, and a Electronic Assembly EA-DOGM162 LCD in serial connection.

    Since I hate reading old posts where the person has the same problem as I did, and solved it, but there is no mention of the solution, I have included working code below.

    Code:
        DEFINE OSC 4
        DEFINE CHAR_PACING 1000  
    @   DEVICE  PIC16F88, INTRC_OSC_CLKOUT, WDT_OFF, PWRT_ON, BOD_OFF, MCLR_OFF, PROTECT_OFF
        disable interrupt
    
        osccon = %01101100
        trisb  = %00000000
             
        LCD_RS_CommandLow VAR portb.1
        LCD_SerialIn VAR portb.2
        LCD_Clock VAR portb.4
    
        SYMBOL mode = 5
              
        pause 40   ' wait for LCD to startup
        shiftout LCD_SerialIn, LCD_Clock, mode, [$38]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$39]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$14]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$78]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$5E]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$6A]
        pause 200
        shiftout LCD_SerialIn, LCD_Clock, mode, [$0C]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$01]
        pause 2
        shiftout LCD_SerialIn, LCD_Clock, mode, [$06]
        pauseus 30
        
        high LCD_RS_CommandLow
        pauseus 2
        shiftout LCD_SerialIn, LCD_Clock, mode, ["Hello world"]
        end
    Best regards
    Richard
    Last edited by mind; - 3rd August 2005 at 17:54. Reason: cleanup un-used variables

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mind
    ...Since I hate reading old posts where the person has the same problem as I did, and solved it, but there is no mention of the solution, I have included working code below.
    Richard, so do we hate this.

    Tell us what the actual problem was, or do you want us to compare your non working code with the working code and then both of them with the datasheet(s)?
    regards

    Ralph

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



  33. #33
    seoman's Avatar
    seoman Guest


    Did you find this post helpful? Yes | No

    Default

    The main problem was:
    The delaytimes to give the displaycontroller sufficient time to perform the instruction.

    The datasheet clairly states the needed time.
    40msec for the controller to initialize
    1.08 ms for a clear display or return home
    the others are 26.3 μs

    For some strange reason the datasheet exaple program uses an 200μs delay after setting the follower control.

    I must say i'm pretty pleased with an SPI interfaced display.
    Low on program code (if spi hardware is used)
    only 3(4) wires needed to write to the display!!

    1 commend to Mind
    You can connect more devices to one spi bus!

    Regards, Simon
    Last edited by seoman; - 30th November 2006 at 11:33.

  34. #34
    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

  35. #35
    hyonjlee's Avatar
    hyonjlee Guest


    Did you find this post helpful? Yes | No

    Default Questions

    Hi! I am struggling with the same problem. I have DOG-M081 (1 line 8 char) LCD which has ST7036 controller.

    Whatever I write serially, it doesn't acknowledge. Would you provide me the full code showing how CSB, RS, SCL, and SDA should work.

    Best regards,

    HJL

    Quote Originally Posted by mind View Post
    Hi guys

    Solved the problem. It really is simple, once you look at it. Did this with a PIC16F88, and a Electronic Assembly EA-DOGM162 LCD in serial connection.

    Since I hate reading old posts where the person has the same problem as I did, and solved it, but there is no mention of the solution, I have included working code below.

    Code:
        DEFINE OSC 4
        DEFINE CHAR_PACING 1000  
    @   DEVICE  PIC16F88, INTRC_OSC_CLKOUT, WDT_OFF, PWRT_ON, BOD_OFF, MCLR_OFF, PROTECT_OFF
        disable interrupt
    
        osccon = %01101100
        trisb  = %00000000
             
        LCD_RS_CommandLow VAR portb.1
        LCD_SerialIn VAR portb.2
        LCD_Clock VAR portb.4
    
        SYMBOL mode = 5
              
        pause 40   ' wait for LCD to startup
        shiftout LCD_SerialIn, LCD_Clock, mode, [$38]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$39]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$14]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$78]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$5E]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$6A]
        pause 200
        shiftout LCD_SerialIn, LCD_Clock, mode, [$0C]
        pauseus 30
        shiftout LCD_SerialIn, LCD_Clock, mode, [$01]
        pause 2
        shiftout LCD_SerialIn, LCD_Clock, mode, [$06]
        pauseus 30
        
        high LCD_RS_CommandLow
        pauseus 2
        shiftout LCD_SerialIn, LCD_Clock, mode, ["Hello world"]
        end
    Best regards
    Richard

  36. #36
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by hyonjlee View Post
    Hi! I am struggling with the same problem. I have DOG-M081 (1 line 8 char) LCD which has ST7036 controller.
    Whatever I write serially, it doesn't acknowledge. Would you provide me the full code showing how CSB, RS, SCL, and SDA should work.
    Best regards,
    HJL
    And we know nothing about what you have done already...

  37. #37
    wappen's Avatar
    wappen Guest


    Did you find this post helpful? Yes | No

    Default this solved my dogm162 problem...

    Hi,

    After some consulting from this thread I got my dogm162 display to work too. I had some problem with the initialize after bootup, but still when it was working ok, it didn't boot up everytime I tried...

    It was the most simple problem in the world. For some reason I didn't use pulldown/up resistors for the serial lines. So i added three pulldown resistors to the datalines, and voila, it works everytime. Maybe you dont have this problem, but I think it worth mention.

    By the way, my first post ever in this forum

    //Mike

  38. #38
    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