Char. LCD and 18F452 on 20 MHz not work


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    6

    Default Char. LCD and 18F452 on 20 MHz not work

    Char. LCD and 18F452 on 4 MHz working, but on 20 MHz not work.

    Please help me.

    Code:
    define LCD_BITS 4
    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTC
    DEFINE LCD_RSBIT 6
    DEFINE LCD_EREG PORTC
    DEFINE LCD_EBIT 7
    DEFINE LCD_LINES 4
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50
    
    
    LCDOUT $FE,1,"HELLO WORLD"

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


    Did you find this post helpful? Yes | No

    Default

    Did you tell PBP that you are using 20 mhz

    DEFINE OSC 20
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Did you tell PBP that you are using 20 mhz

    DEFINE OSC 20
    Yes mackrackit.
    And OSC = HS
    But PBP not compile 18f452 to hex, MPASM compiling to hex. And MPASM compiling on (default) 4 MHz only.
    Last edited by samettin; - 27th July 2008 at 17:14.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by samettin View Post
    Yes mackrackit.

    But PBP not compile 18f452 to hex, MPASM compiling to hex. And MPASM compiling on (default) 4 MHz only.
    MPASM is required for 18s.
    How do you know it is doing 4 MHz? Did you change the congig (*.inc) to HS?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jul 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    I m sorry, i changed my message

    I did change OSC to HS.

    LCD vorking with 18F452 on 4 MHz xtal and osc config = XT.

    Problem is, if PLL enable with 4 MHz XTAL, or 20 MHz with osc config=HS then.
    Last edited by samettin; - 27th July 2008 at 17:29.

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


    Did you find this post helpful? Yes | No

    Default

    Could you post all of the code and config, not what you think the configs are set for, but a copy paste of the *.inc.
    Dave
    Always wear safety glasses while programming.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by samettin View Post
    Problem is, if PLL enable with 4 MHz XTAL, or 20 MHz with osc config=HS then.
    Might want to also keep in mind that the PLL doesn't work above 10Mhz. The max speed of the PIC is 40Mhz (10 x 4xPLL). Try as you might, you won't get the PIC to run at 160Mhz! (It would be nice, but it won't work )

Similar Threads

  1. 18F452 and 8-bit LCD
    By exelanoz in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th December 2009, 07:57
  2. with 40 MHZ osc serin2 not work
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th August 2006, 22:56
  3. Replies: 5
    Last Post: - 5th February 2006, 16:51
  4. How do I get DATA @ to work with a 18F452?
    By jessey in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd February 2006, 10:35
  5. Why doesn't my code for 18f452 work on 18f252?
    By senojlr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2005, 02:42

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