Serial LCD problem


Closed Thread
Results 1 to 38 of 38

Hybrid View

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

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

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



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

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

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

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

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