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:     
        MOV     #$40,MCGC2             ; Set MCGC2 register
        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