R32C PLL Clock Configuration

I am facing a aproblem when trying to configure the PLL clock in order to set the CPU clock to 50 Mhz

I am using an external Quartz of 8 Mhz and the following setup program:

;*******************************************************

;        Set PLL Speed

;*******************************************************

Set_pll_clock:

            mov.b        #0FFH,prcr        ; Enable write to control registers

            mov.b        #080H,prcr2        ; Enable write to CM3 register

            mov.b        #0AAH,prr          ; Enable write to CCR, FMCR, PBC register

            bclr                pm21            ; Enable clock change

            mov.b        #008H,cm0        ; System clock control register 0

            mov.b        #020H,cm1        ; System clock control register 1   

            mov.b        #000H,cm2        ; Oscillation stop detect register

            mov.b        #002H,cm3        ; Low speed mode clock control register

            mov.b        #000H,tcspr        ; Count source prescaler register   

            mov.b        #080H,tcspr        ; Count source prescaler register

            mov.b        #000H,cpsrf        ; Clock prescaler reset register

            mov.w        #0A0DH,pbc       ; Peripheral bus control register

                                                      ; value depends on setting of CCR register

            mov.b        #013H,ccr        ; Clock control register

            mov.b        #01FH,ccr        ; Clock control register   

            mov.b        #0FFH,prcr       

            mov.b        #004H,plc0        ; PLL control register 0

            mov.b        #0FFH,prcr       

            mov.b        #001H,plc1        ; PLL control register 1

            bclr        seo                       ; PLL mode

            bclr        bcs                       ; Base clock source is PLL

            mov.b        #0FFH,prcr

            mov.b        #020H,pm3        ; Peripheral clock  = PLL/6

            bset        pm21                  ; Disable clock change

            mov.b        #000H,prcr

rts

but can never the desired clock frequency of 100Mhz for the PLL

Thks in advance for your help

Parents Reply Children
No Data