18F877A to 18F876A


Closed Thread
Results 1 to 5 of 5
  1. #1

    Default 18F877A to 18F876A

    Hello
    I can get the following code to work correctly with an 18F877A on the X-1 board. Then I load the same code into an 18F876A and the light won't blink. I am taking power and ground from the X-1 board to pins on the back of a 28-pin adapter to test the 876A.

    Can I use the 28-pin adapter for testing purposes? Is there something I am missing that is different between the 877A and the 876A? I have tested the LED so I know its not burnt out. Also I have tried three 876A PICS. Any input appreciated. Also I am learning how to set registers. Please advise concerning ADCON1, CMCON etc assuming commented input/output signals for each pin

    Thanks
    Toby

    include "bs2defs.bas"
    ADCON1=%00000111 'Turn off PortA A/D's
    CMCON=%00000111 'Turn off Port A Comparator
    OPTION_REG.7=0 'Enable Pull-Ups for BCD
    TRISA = %111110 ' Port A0=LED PortA1-5=Digital Inputs
    TRISB=$FF 'Port B Input for BCD

    Light Var PortA.0
    Flasher VAR byte
    Flasher = 0

    repeat
    GOSUB ON_Off
    Flasher = Flasher + 1
    UNTIL Flasher = 2

    On_Off:
    HIGH Light
    PAUSE 500
    LOW Light
    PAUSE 500
    RETURN

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello Tobias,

    Did you take the time to look at the datasheets on each of the uP's to see what the differences are in the settings.

    You do realize the pinouts are different between the two. If you only took power from the X1 and connected it to the 28 pin then what have you done with MCLR? It needs to be tied to Vdd in order for the chip to work properly. As I glanced over the datasheet (it's the same for both) I didn't see any differences in the registers with a quick scan but I could be wrong. Also the "A" version chips need a .1uF bypass capacitor as close as possible to the power pins. What are you using for an oscillator, internal or external, and if external how do you have it connected to the adaptor?

    HTH,

    BobK
    Last edited by BobK; - 9th November 2007 at 18:48. Reason: After thoughts

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Bob I figured it out. Internal OSC!!! Does my ADCON etc look correct for configuring the ports? I am going to go with a 16F866 with the internal OSC. Whats the benefit of an external OSC?
    Last edited by Tobias; - 9th November 2007 at 18:47.

  4. #4
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default 18f ?

    I Guess 16F not 18F
    16F877A to 16F876A ???
    not 18F877A to 18F876A

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    1) 16F876A has no internal OSC
    2) your program work... even if he will fall in a under-stack event soon.
    3) your ADC/Comparator settings are OK
    4) external OSC is needed if you need timing accuracy. Internal OSC are nice, but shift with temperature, humidity, gas price, CAN$-USD$-CAN$ currency, wind direction etc etc. For most jobs they're nice enough and give 2 free i/o.

    HTH
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 18f877a??????
    By comwarrior in forum General
    Replies: 3
    Last Post: - 27th September 2009, 20:40
  2. problem RB4-7 on a 18F876A
    By mischl in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th March 2006, 14:30

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