16f887 to 18f4685 transition


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    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

    Is the 18f4685 connected to the TellyMate with the same hardware as the 16f887 was?
    Sorry that I am not able to spot the problem right off.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    hey no need to apologize, but yes, the 18f4685 is attached to the same hardware as the 16f887. I chose the 18f4685 because it had an identical pinout to the 16f887 so all I would have to do is swap the chips on my breadboard. I would provide a schematic if I had one but I can't draw one up in multisim.

  3. #3
    Join Date
    May 2009
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    I think your problem may be caused by your oscillator frequency. When using the 16f887 what oscillator were you using? When using the usart frequency you should use a crystal oscillator for stable operation. Your oscillator configuration for the 18f chip appears to use internal irc oscillator which may not be good enough for reliable operation.

  4. #4
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    I have always used the 8 MHz internal oscillator. I've done serial communications with the 16f887, 16f688, and 16f630 all with internal oscillators (simply because I don't have any crystals around to use), but I do agree that it's some kind of timing error.

  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

    Poking around the datasheet a bit I notice that the setting for TRISC.6 is opposite for the 18F4685 compared to the 18F4550. I do not have an 18F4685 so I can not test.

    I wonder if PBP is setting these correctly, not often but sometimes things are over looked, but this chip has been around for awhile....

    Anyways, it can not hut to set this manually in your code.
    From the datasheet, section 18:
    The pins of the Enhanced USART are multiplexed
    with PORTC. In order to configure RC6/TX/CK and
    RC7/RX/DT as an EUSART:
    • bit SPEN (RCSTA<7>) must be set (= 1)
    • bit TRISC<7> must be set (= 1)
    • bit TRISC<6> must be cleared (= 0) for
    Asynchronous and Synchronous Master modes,
    or set (= 1) for Synchronous Slave mode
    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

    Good eye. I'll try that and get back to you later.

  7. #7
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 16f887 to 18f4685 transition

    I added this to my code but yet again nothing has happened. I also have tried it without TXSTA and BAUDCON.

    Code:
    TXSTA = %10100000
    RCSTA = %10110000
    BAUDCON = %10000010
    trisc.6 = 0
    trisc.7 = 1

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