Serial LCD problem


Closed Thread
Results 1 to 38 of 38

Hybrid View

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



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

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



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

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



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

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



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

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



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

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



  12. #12
    mind's Avatar
    mind Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Ralph,

    Nope...

    Best regards
    Richard

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