PIC18F14K22 and PLL (4 x Phase Lock Loop)


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    13

    Default PIC18F14K22 and PLL (4 x Phase Lock Loop)

    Hi

    I am trying to run a PIC18F14K22 in PLL mode with internal oscillator and PLL (i.e. frequency x 4). The internal clock should be 64'000'000 MHz. Here is my sample code:

    Code:
    asm
        __CONFIG    _CONFIG1H, _FOSC_IRC_1H & _PLLEN_ON_1H & _PCLKEN_ON_1H & _FCMEN_ON_1H & _IESO_ON_1H
        __CONFIG    _CONFIG2L, _BOREN_OFF_2L
        __CONFIG    _CONFIG2H, _WDTEN_OFF_2H & _WDTPS_128_2H
        __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _BBSIZ_ON_4L & _XINST_OFF_4L
        __CONFIG    _CONFIG7L, _EBTR0_ON_7L
    endasm
    
        TRISA = 0
    
    main:   
    asm
        BSF PORTA, 0
        BCF PORTA, 0
        BSF PORTA, 0
        BCF PORTA, 0
        BSF PORTA, 0
        BCF PORTA, 0
    endasm
    
        goto main
        
        end
    This peace of code is assumed to deliver 3 pulses again and again. I got on my scope 3 pulses at 4.20 us duration and I was expecting about 15 ns each pulse duraton since the BSF and BCF instructions last one clock cycle and that cycle should last about 15 ns.

    See annexed image for result details on scope.

    Any advice to me?

    Many thanks in advance.
    Attached Images Attached Images  

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Did you set the OSCCON register? Otherwise it will default to 1 mhz (x4 pll) = 4 mhz.
    http://www.scalerobotics.com

  3. #3
    Join Date
    Mar 2007
    Posts
    13

    Default PIC18F14K22 and PLL (4 x Phase Lock Loop)

    Quote Originally Posted by scalerobotics View Post
    Did you set the OSCCON register? Otherwise it will default to 1 mhz (x4 pll) = 4 mhz.
    I didn't do that setting before. I did it now and everything works fine now.

    Thank you so much for your help.

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