Problems with 18F458


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    100ms delay before you initialize your display could be too short. Many displays needs alot more. Try a couple of seconds and see if that makes it work.

  2. #2
    Join Date
    Aug 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Unhappy

    No, I tried everything, removed the caps, set the most of the conf. bits to be negative, moved the osc. closer, increased the init delay (though it has worked well with 100 with the same display but a PIC16F84)....nothing helps, it still writes "!" in the start of the first line instead of the "Hello world!"

  3. #3
    Join Date
    Aug 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Btw. here is a picture of my cfg.
    Attached Images Attached Images  

  4. #4
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Switch OFF LVP and BOR (brown-out-reset). If does not help, send your full code, i'll try to simulate it.
    Btw, do you use 8 or 4-bit interface to LCD?

    PS. Are you sure your code worked and that you ported it correctly? Type of LCD is also interesting.
    PS/1. X-tal must be placed right next to uP, no wires!

  5. #5
    Join Date
    Aug 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    LVP & BOR off, now it is only the cursor that blinks in the start of the line, no letters, I have my x-tal next to the uP no caps, I use 4 bit connection, with the RW pin grounded (thats why the initialize delay is 100, I did that for decreasing the number of pins used on my old PIC). Well, the display uses a normal 44780 controller it has the normal japaneese signs in the end of the ASCII table replaced with kyrillic letters, since I bought the LCD in Russia, there are really not much more about the display. Btw. I noticed, that when I short the x-tal pins with my finger, the text gets on it's right place, but as soon as I remove my finger it gets back to the blinking at the start of line 1.

    Here is my full code and the LCD library (not mine, I only edited it).
    Attached Files Attached Files

  6. #6
    Join Date
    Sep 2004
    Location
    Tallinn, Estonia
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Russian
    Btw. I noticed, that when I short the x-tal pins with my finger, the text gets on it's right place, but as soon as I remove my finger it gets back to the blinking at the start of line 1.
    Haa, this might explain everything! What's your clock freq.? Too high possibly. Anyway, I'll take a look at the code now.

    Did you know that sub delay100 actually delays only 1,4 ms!!! ? Otherwise code works OK (on PIC18F452). You must add delays:
    - before initializing LCD, about 100mS (use MPLAB-s simulator to check time)
    - delay about 2mS after sending cmd or data to LCD (in the lib file)
    See code.
    Attached Files Attached Files
    Last edited by Felch; - 29th August 2005 at 18:07.

  7. #7
    Join Date
    Aug 2005
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Sorry, but i have never tried to use MPLAB so I don't know how to use the simulator =( But, that delay, you added in the end of the LCD.lib file, there stands that it is written for an 11,0592MHz clock how should I handle that? Anway, I tried to compile the program and run it, well there stands a 0 in the end of line1 and there stands something wird in the end of line 2...And, btw. how do I make that 100mS delay before init (I am a almost total lost, especially when things don't work)? Just add a loop that takes your routine 100 times?

    Thanks for great responding!!!

Similar Threads

  1. Problems programming
    By Lionheart in forum General
    Replies: 4
    Last Post: - 7th December 2008, 16:51
  2. bootloader Freqout problems
    By handgio in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th December 2007, 13:38
  3. Problems with PORTD on 18F658
    By blainecf in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th June 2006, 17:32
  4. Problems with 16F876 on interrupts an WRITE / READ
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2005, 14:38
  5. USART problems
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 6th March 2005, 21:45

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