16f887 to 18f4685 transition


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    48

    Default 16f887 to 18f4685 transition

    How would I go about configuring the 18f4685 so I can use the pins as simple I/O ports along with the serial communication pins 25 and 26? I have this configuration so far but it doesn't seem to work.


    Code:
    define device 18f4685
    OSCTUNE = %11000000
    OSCCON = %01110000
    define OSC 8
    CMCON = 0
    ADCON0 = 7
    ADCON1 = 7
    ADRESH = 7
    ADRESL = 7
    INTCON = 0
    INTCON2 = 0
    INTCON3 = 0
    IPR1 = 0
    PIR1 = 0
    PIE1 = 0
    
    
    DEFINE HSER_RCSTA 90h ' Enable Serial PORT
    DEFINE HSER_TXSTA 24h ' Enable transmit
    DEFINE HSER_SPBRG 129 ' set USART to 9600 baud (when BRGH=1)
    DEFINE HSER_CLROERR 1 ' Enable automatic overrun error
    DEFINE LOADER_USED 1
    The program I'm using was previously written on the 16f887, and the program work fine on that chip, so I'm assuming the 18f4685 isn't configured properly. The datasheet for the 18f4685 is below. Thanks for the help.

    http://ww1.microchip.com/downloads/e...doc/39761b.pdf

  2. #2
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    I forgot to add I'm using MicroCode Studio with PicBasic Pro.

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


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    But are you using MPASM and how are the configs set?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    I am using MPASM v5.1 with Processor, Radix, Warning Level, Macro Expansion, and Hex Output set to default;
    Generated File has Error and List files selected; Case Sensitive is also selected.

    Are those what you meany by the configuration settings?

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


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    No, I don't have anything nor have ever used anything like that before to my knowledge. I looked into the devices folder within my MPASM installation and I didn't see it in the list. Could that be why it isn't working?
    Last edited by emerson; - 21st July 2012 at 07:36.

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