Weird Oscillator Problem


Closed Thread
Results 1 to 3 of 3
  1. #1
    eoasap's Avatar
    eoasap Guest

    Default Weird Oscillator Problem

    14.7546 MHz crystal
    PIC18LF8722
    MPLAB v7.22 (with config fuse set to HS)


    DEFINE osc 16
    asm
    __CONFIG _CONFIG1H, _OSC_XT_1H
    endasm


    works perfect, display to LCD fine, but delay is off (delay 100 is has about a 500ms delay). If i change the above fuse to:

    asm
    __CONFIG _CONFIG1H, _OSC_HS_1H
    endasm

    then speed seems normal, but output to LCD is messed up, characters missing, different line display, etc..

    Any ideas what's wrong?

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    My suspicion is that when you have the oscillator type set to 'XT' and you have such a high frequency crystal, you are actually running at a sub-multiple of the actual frequency. Since the PIC is running so slow, the LCD has no trouble responding.

    When you set the oscillator type to 'HS' it then runs at the true crystal frequency (14.7xMhz), and the LCD can't keep up.

    Add the lines

    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 200

    To the top of the program, the LCD will work and your program will run fast.
    Charles Linquist

  3. #3
    eoasap's Avatar
    eoasap Guest


    Did you find this post helpful? Yes | No

    Default

    that worked, but i think maybe the PLL is enabled becuase even a pause 2000 seems like about 1/2 second or so (i dont have a scope to measure the exact frequency). i dont see how
    __CONFIG _CONFIG1H, _OSC_XT_1H
    would set the HS+PLL but it definately seems faster than ~15Mhz.


    lcdout cmd, clr 'clears the LCD screen
    pause 200 ' if this pause is not here, it will just print line1 as blank
    lcdout cmd, line1, "14.7456 MHz"
    pause 200 ' if this pause is not here, it will print a blank screen on line 2
    lcdout cmd, line2, " Crystal Test"
    pause 4000 ' this is about a 1 second pause
    Last edited by eoasap; - 17th December 2005 at 15:49.

Similar Threads

  1. Weird Problem
    By isaac in forum General
    Replies: 9
    Last Post: - 22nd September 2008, 20:30
  2. LCD and PIC18F2685 - Weird LCD behavior
    By Castor in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th April 2008, 10:55
  3. PIC16F877 Weird behavior
    By fadibasic in forum General
    Replies: 1
    Last Post: - 27th April 2008, 01:03
  4. Weird flicker
    By The Master in forum Off Topic
    Replies: 10
    Last Post: - 9th December 2007, 19:58
  5. Weird Oscillator Problems
    By CocaColaKid in forum Off Topic
    Replies: 5
    Last Post: - 2nd September 2005, 23:19

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