AnsweredAssumed Answered

s08JM60 osc trimming

Question asked by donw on Apr 20, 2009
Latest reply on Apr 20, 2009 by David Payne

I am powering up my first hardware using s08JM60.

I am very unsure about the operation of the Clock Generator  (MCG)...

Using the cpu internal ~32.7khz oscillator I can trim the bus frequency by altering values in MCGTRM

[using the code below, the default TRIM value $80 gives a bus freq that gives me 115K baud out the serial comms SCI unit]

 

Using an external 32.768 khz oscillator, the bus freq. is ~10% too slow (for 115K baud generation) and the MCGTRM value does not alter the bus freq.

 Is this correct? How can I trim to get 115K baud?

 

 

internal  osc startup code:     
        ; MCGC2: BDIV=1,RANGE=0,HGO=0,LP=0,EREFS=0,ERCLKEN=0,EREFSTEN=0
        MOV     #$40,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

 

 external osc startup code is as above but does 

     MOV     #$06,MCGC1 

Outcomes