Question about 18F4450


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Florida
    Posts
    64

    Default Question about 18F4450

    I am trying out an 18F4450 on the LAB-X1 board.

    Code:
    '****************************************************************
    '*  Name    : Hello.BAS                                      *
    '*  Author  : Ted Crafton                                       *
    '*  Notice  : Copyright (c) 2008 PROGRAM SPECS                  *
    '*          : All Rights Reserved                               *
    '*  Date    : 6/10/2008                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    CLEAr
    define      LCD_DREG    PORTD
    DEFINE      LCD_RSREG   PORTE
    DEFINE      LCD_RSBIT   0
    DEFINE      LCD_EREG    PORTE
    DEFINE      LCD_EBIT    1
    DEFINE      LCD_RWREG   PORTE
    DEFINE      LCD_RWBIT   2
    DEFINE      LCD_BITS    8
    DEFINE      LCD_LINES   2
    DEFINE      LCD_COMMANDUS   2000
    DEFINE      LCD_DATAUS      20
    
    TRISD=%00000000
    TRISE=%00000000
    
    ADCON1=%00000111
    
    LOOP:
     LCDOUT $FE,1
     PAUSE 500
     LCDOUT "HELLO"
     pause  500
     LCDOUT $FE,$C0
     LCDOUT "Jan Crafton"
     PAUSE 500
    GOTO LOOP
    END
    If runs I have flashing LEDs, however the LCD only displays a row of blocks. I figure I either have bad fuses or some else real simple can someone point me in the right direction.

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


    Did you find this post helpful? Yes | No

    Default

    A row of blocks on the LCD might be the contrast needs adjusted. Pin #3 on the LCD.

    More info would help.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The 18F4550 has analog functions on PORT's A, B and E.

    ADCON1=%00000111

    Doesn't turn them all off.
    <br>
    DT

  4. #4
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Default

    Darrel

    Provided the right clue, I had overlooked one PORT. Reread the datasheet and discovered the error of my ways.

    ADCON1 = %00001111 did the trick.

    Thank you kind sir.

  5. #5
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Default

    Also overlooked the fact that I ordered the wrong PIC. I wanted a 18F4550 but ordered 18F4450 and then couldn't figure out why no I2C. 4550 has and 4450 does not.

    If someone needs a couple of 18F4450 let me know.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Don't give them away yet.

    Did you know that the PBP I2C commands don't use the Hardware MSSP module?

    You can still use I2CREAD and I2CWRITE.
    <br>
    DT

  7. #7
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by manwolf View Post
    Also overlooked the fact that I ordered the wrong PIC. I wanted a 18F4550 but ordered 18F4450 and then couldn't figure out why no I2C. 4550 has and 4450 does not.

    If someone needs a couple of 18F4450 let me know.
    Funny you say that, I just completed a project where I made the same mistake in ordering the breadboard parts: got 4450 and thought I had 4550's.

    Lead to some funny bugs because I was using a different compiler and there the target mattered (due to the differing ammount of RAM).

    Also, both devices host the same MSSP Module, so hardware I2C is the same on both. (I'm sure of this because I wrote code to use it on the 4450 that recompiled & ran flawlessly once I got the correct 4550's.)

Similar Threads

  1. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  2. FREQOUT - PWM question
    By Etcho in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th February 2007, 23:51
  3. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

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