I can not figure out an LCD issue


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default

    Thanks Malc-C for the reply but I am not exactly trying to make it work...
    Well yes I am trying to make it work but first I am trying to understand what is happening and what is my issue.

    Mackrackit,
    I am using a resonator (3 pins with caps incorporated) and double checked the datasheet and it does suggest _XT_OSC for a 4 MHz resonator.

    I followed your suggestion and I put a LED with puse 1000 and also it is taking 2 secs to blink. Now, I set DEFINE OSC 4 instead of 8 which brought down to 1 sec as I expected so I know that if i am using a 4 MHz crystal, I should be having DEFINE OSC 4. I could be wrong but I think this part is clear to me.

    So my questions are changing a bit and now I end up with:

    1 - Why does LCD_AnyPin only works with DEFINE OSC 8 although I have a 4 MHz crystal ?

    2 - Why the standard way for LCD is not working whisle LCD_AnyPin did even at 8 ?

    When I find out, I will never forget it!

    Mike

  2. #2
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default

    after reading over the thread I just saw this:
    Using DEFINE OSC 20 I had erroneous results on the LCD, so it's obviously a timing issue with your 4MHz resonator
    I took out my resonator and used the chips' internal oscillator but I get the same results so this rules out the resonator I was using.

    When using LCD_AnyPin it works with 8 MHz but the timing is doubled, if I set to 4 MHz the timing is is ok and LCD is blank.

    Furthermore using standard settings for LCD does not work at all settings for OSC.

    Help!

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The only suggestion I have now is to play with these lines.
    Code:
    DEFINE LCD_COMMANDUS 2000       ' Command delay time in us 
    DEFINE LCD_DATAUS 50            ' Data delay time in us
    Use the 4 MHZ OSC
    DEFINE OSC 4
    Dave
    Always wear safety glasses while programming.

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lilimike View Post
    after reading over the thread I just saw this:


    I took out my resonator and used the chips' internal oscillator but I get the same results so this rules out the resonator I was using.

    When using LCD_AnyPin it works with 8 MHz but the timing is doubled, if I set to 4 MHz the timing is is ok and LCD is blank.

    Furthermore using standard settings for LCD does not work at all settings for OSC.

    Help!
    Mike,

    That's why I included the statement. With a 20Mhz xtal and setting the define to 20 I got random parts of the text displayed. When I set the define to 48 it worked - why I don't know (I'm still a newb to a degree My guess is that the value is divided internally somewhere to set the timing, which is why in your case setting it to 8 works with a 4Mhz xtal

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  3. LCD issue with EasyPIC5
    By manwolf in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 15th June 2008, 09:17
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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