Re: 16f886 will not work but a 16F876A is running fine.


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Eddy
    Guest Eddy's Avatar

    0 Not allowed!

    Default Re: 16f886 will not work but a 16F876A is running fine.

    Hi. I have a PIC 16F876A with a small PICbasic Code and this work fine but when I change The PIC for a PIC16F886
    nothing works. What did I forget? I check the CONFIG BITs
    Please can you help me out?

    The PICBasic Code IS:

    Device 16F876A ; this id okay
    ;Device 16F886
    ;Config WDT_Off, PWRTE_ON, HS_OSC , PWRTE_ON, lvp_off


    Device = 16F886 ; will not work at all
    @ CONFIG_REQ
    @__CONFIG _CONFIG1, DEBUG_OFF & LVP_OFF & FCMEN_OFF & IESO_OFF & BOR_OFF & CPD_OFF & CP_OFF & MCLRE_ON & PWRTE_ON & WDT_OFF & XT_OSC
    @__CONFIG _CONFIG2, WRT_OFF & BOR21V

    ANSEL=0
    ANSELH=0


    XTAL = 10

    Dim I As Byte ' Define loop variable

    Symbol LED = PORTC ' Alias PORTB to LEDS

    DelayMS 500 ' Wait for PICmicro to stabilise
    TRISC = %00000000 ' Set PORTB to all output

    While 1 = 1
    LED = 1 ' First LED on
    DelayMS 500 ' Delay for .5 seconds

    For I = 1 To 7 ' Go through For..Next loop 7 times
    LED = LED << 1 ' Shift on LED, one to left
    DelayMS 500 ' Delay for .5 seconds
    Next

    Wend ' Go back to loop and blink LED forever

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster C_Moore's Avatar
    Join Date
    Sep 2004
    Posts
    1,393
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    704.59 MB

    0 Not allowed!

    Default Re: 16f886 will not work but a 16F876A is running fine.

    Try changing your osc setting to HS_OSC instead of XT_OSC.
    Regards:)
    [color=Blue][b]Charlie M.[/b][/color]

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Inactive member SYSTEMVR's Avatar
    Join Date
    Jun 2014
    Posts
    1
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    361.66 MB

    0 Not allowed!

    Post Re: 16f886 will not work but a 16F876A is running fine.

    Quote Originally Posted by C_Moore View Post
    Try changing your osc setting to HS_OSC instead of XT_OSC.
    USA ESTE CODIGO A MI ME FUNCIONA DE MARAVILLA YO USOS EL CRISTAL EXTERNO AMIGO Y EL RESET INTERNO
    ESPERO QUE TE FUNCIONE SALUDOS DESDE MEXICO


    Device 16F886
    XTAL= 16

    ALL_DIGITAL = OFF
    PORTB_PULLUPS = On


    ASM
    CONFIG_REQ
    __CONFIG _CONFIG1, HS_OSC & WDT_OFF & DEBUG_OFF & FCMEN_OFF & IESO_OFF & BOR_OFF & LVP_OFF & CPD_OFF & CP_ON & MCLRE_OFF & PWRTE_OFF
    __CONFIG _CONFIG2, WRT_OFF & BOR40V
    ENDASM

    ANSEL=000000'all analogue ports to digital
    ANSELH=000000'all analogue ports to digital
    ADCON0.0=0'disable ADC
    CM1CON0=000000'disable COMPARATOR 1
    CM2CON0=000000'disable COMPARATOR 2
    SSPCON=000000'disable SERIAL PORT
    RCSTA=000000'disable SERIAL PORT
    PCON=000000'disable BOR and ULPW
    OPTION_REG=000000'disable INTERNAL PULLUPS
    WPUB=000000'disable INDIVIDUAL PULLUPS
    IOCB=000000'disable INTERRUPT ON CHANGE
    CCP1CON=000000'disable ECCP1
    CCP2CON=000000'disable ECCP1
    PSTRCON=000000'disable PULSE STEERING MODE
    T1CON=000000'disable TIMER1

    '................................................. ..............................
    TRISB=000011 'P
    TRISA=000001
    TRISC=001100 'P

    PORTB=0
    PORTA=0
    PORTC=0
    Last edited by SYSTEMVR; 9th October 2019 at 00:42.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Looking for some help with interrupt on 16F876A
    By radiotek in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 7th March 2011, 03:45
  2. Can't get 16F876A to work
    By theove in forum Proton Plus Compiler v3
    Replies: 15
    Last Post: 12th April 2010, 20:03
  3. Fine Pitch Pics Soldering
    By fanie in forum The Lounge
    Replies: 4
    Last Post: 5th September 2008, 13:07
  4. Samsung GLCD works on 16F876A, not on 16F886
    By Wim26 in forum Proton Plus Compiler v3
    Replies: 19
    Last Post: 17th April 2008, 16:00
  5. Capture setting on 16F876A ??
    By maxiboost in forum Proton Plus Compiler v3
    Replies: 32
    Last Post: 20th April 2007, 01:01

Members who have read this thread since 11th October 2019, 17:29 : 4

Actions :  (Set Date)  (Clear Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts