External clock


Closed Thread
Results 1 to 2 of 2

Thread: External clock

  1. #1
    Join Date
    Jan 2007
    Posts
    11

    Default External clock

    It is my first time using an external oscillator. I am using an 18F4525. I have connected a ABRACON Half Size TTL/HCMOS Clock Oscillator PN/ACH-40-EK to the OSC1 pin (40.0 mHz). The oscillator outputs a saw tooth wave form from 1.8 volts to 3.1 volts.

    The clock speed of the 18F4525 appears to be about 400 times too slow. Nothing I do changes to speed. I am also unable to get the Fosc/4 signal out of OSC2 when I configure OSC = EC.

    The LED changes state approx every four seconds if I use the code:

    DEFINE OSC 40
    TRISA.1 = 0
    ch1 var PORTA.1

    loop:
    HIGH ch1
    PAUSE 100
    LOW ch1
    GOTO loop

    I have edited my 18F4525.inc file located in my c:\pbp directory to the following:

    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F4525, r = dec, w = -311, f = inhx32
    INCLUDE "P18F4525.INC" ; MPASM Header
    CONFIG OSC = ECIO6 ; Ext Clock with I/O on RA6
    CONFIG IESO = OFF ; Disable Internal External Osc. Switch Over
    CONFIG PWRT = OFF ; Disable Power-up Timer:
    CONFIG BOREN = OFF ; Disable brownout reset
    CONFIG WDT = OFF ; Disable watch dog timer
    CONFIG MCLRE = OFF ; MCLR pin disabled; RE3 input pin enabled
    CONFIG PBADEN = OFF ;Port B A/D disabled
    CONFIG LVP = OFF ;Low voltage ISCP disabled
    CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor disabled
    NOLIST

    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 8


    I have also tried:
    OSCCON.0 = 0
    OSCCON.1 = 0

    Do I have the wrong part?
    Is my configuration wrong?
    Does the wave form from the oscillator need to cross zero?

  2. #2
    Join Date
    Jan 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Got it working, it appears there was something wrong with the oscillator. The bottom of the wave is now < 1 volt.

    Nevermind.

Similar Threads

  1. Data Out From External Clock
    By Quin in forum Serial
    Replies: 2
    Last Post: - 25th October 2008, 09:11
  2. 16F887 20Mhz External Clock Problems
    By modifyit in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd September 2008, 13:11
  3. external clock / internal clock
    By grounded in forum General
    Replies: 4
    Last Post: - 31st May 2008, 17:44
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. How to set external clock source in PBP
    By TurboLS in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 19th February 2005, 15:56

Members who have read this thread : 1

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