donw

JM60 internal osc problem

Discussion created by donw on Nov 23, 2009
Latest reply on Dec 1, 2009 by donw

Hi all

I have a 908JM60 which is initilised with the code below, so the internal osc gives a bus ~8mhz

This work fine, until I try to call the code again while running, if which case it loops on the while_Cpu0

(ie the lock bit is never set)

What is wrong?

 

      sei      
        ; MCGC2: BDIV=1,RANGE=0,HGO=0,LP=0,EREFS=0,ERCLKEN=0,EREFSTEN=0
        MOV     #$040,MCGC2             ; Set MCGC2 register
        ; MCGC1: CLKS=0,RDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0
        MOV     #$06,MCGC1             ; Set MCGC1 register
        ; MCGC3: LOLIE=0,PLLS=0,CME=0,VDIV=1
        MOV     #$01,MCGC3             ; Set MCGC3 register
while_Cpu0:                            ; Wait until FLL is locked
         BRCLR   6,MCGSC,while_Cpu0
        cli

       rts

Outcomes