how to use external crystal?


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Oct 2014
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: how to use external crystal?

    I don't have any "device.reference" subdirectory associated with pbp3. Maybe I need to uninstall and reinstall the software.

    When I read the device after programming it doesn't list the config memory location 2007. All the registers read 0 so not sure if osccon is being set correctly.


    Also, I get a ASM warning: found directive in column 1. (__config)
    When I indent 1 space it goes away. Not sure if that matters.


    I'm at a loss on what to try next. It seems like it is ignoring config and osccon and just operating at default conditions. I can select the internal oscillator frequency with osccon but I can 't get it to run in external crystal mode. I am in trouble if I can't get this to work.




    This is the beginning of the .asm listing if that gives any information: (also, how do I make a scrolling code window within this reply?)


    ; PICBASIC PRO(TM) Compiler 3.0.7.4, (c) 1998, 2013 microEngineering Labs, Inc. All Rights Reserved.
    MPASMWIN_USED EQU 1

    #define PBP_PATH C:\PBP3\




    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F88x.INC' ; PM header
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F886, r = dec, w = -302, c = 255
    INCLUDE "P16F886.INC" ; MPASM Header
    NOLIST
    endif
    LIST


    PBP_HARDWAREDEF macro
    endm


    __config _CONFIG1, _HS_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOR_ON & _IESO_ON & _FCMEN_ON & _LVP_OFF & _DEBUG_OFF
    __config _CONFIG2, _BOR40V & _WRT_OFF



    ; Define statements.
    ; C:\PBP3\DEVICES\PIC16F886.PBPINC 00172 DEFINE CODE_SIZE 8
    #define CODE_SIZE 8
    ; C:\USERS\TBARANIA\DOCUMENTS\MY DOCUMENTS\WEATHER STATION TOWER\7725_RADIATION SENSOR_GEIGER\GEIGER.PBP 00028 define OSC 20 '20 MHz CLOCK FREQUENCY
    #define OSC 20

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: how to use external crystal?

    On page 100 of the manual it shows listing the config fuses in a different format than you've been using. Could be worth trying.

    In the above you've got #define OSC 20 and you need to get rid of the pound sign. I'm assuming that would be the same for the code-size statement also.

    You could also do most of the above with the CONFIG1=xxxxxxxx and CONFIG2=xxxxxxxx. Something else to try maybe.

    Just a few thoughts that may be horribly bad.

  3. #3
    Join Date
    Oct 2011
    Location
    Pennsylvania
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: how to use external crystal?

    What happens if you turn _IESO_ON to _IESO_OFF ? In CONFIG of course. Is there a way to detect if the crystal oscillates?

  4. #4
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: how to use external crystal?

    I found this and thought it might help http://ww1.microchip.com/downloads/e...efinitions.pdf. It might be of interest.

Similar Threads

  1. 1 x external crystal oscillator for multiple PICs
    By harryweb in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th November 2013, 14:05
  2. Help using this crystal?
    By Kamikaze47 in forum General
    Replies: 5
    Last Post: - 14th November 2009, 14:48
  3. 16f877A and tmr1 external crystal question
    By comwarrior in forum General
    Replies: 3
    Last Post: - 13th July 2009, 00:40
  4. Pic or Crystal
    By jetpr in forum General
    Replies: 2
    Last Post: - 16th September 2008, 01:56
  5. Crystal
    By leonel in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 12th April 2005, 16:05

Members who have read this thread : 1

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