ikauf ikauf

MC9S08SH8 external clocksource

Discussion created by ikauf ikauf on Dec 20, 2009
Latest reply on Dec 21, 2009 by ikauf ikauf

Hello!

 

I use a 12Mhz external crystal on MC9S08SH8 device. But it seems that the Busclock is devided by two. How can I use the full 12Mhz as busclock? Please look at my configuration for ICSC1 and ICSC2

 

ICSC1 is configured as CLKS 10, RDIV 000, IREFS 0, IRCLKEN 0, IREFSTEN 0

ICSC2 is configured as BDIV 00, RANGE 1, HGO 1, LP 0, EREFS 1, ERCLKEN 1, EREFSTEN 1

 

I wrote a small testroutine for SCI module. It only work correctly with BR Factor HEX 27. So Busclock must be ~6Mhz.

 

code:

 

_Startup:
            LDHX   #RAMEnd+1        ; initialize the stack pointer
            TXS
            CLI                     ; enable interrupts
            lda #%00000011          ; Watchdog off,Stopmode off, Resetpin enabled, BDM enabled
            sta SOPT1
            lda #%10000000          ; use external crystal
            sta ICSC1
            lda #%00110111
            sta ICSC2
            jsr delay1              ; external Clocksource needs some time.
            jsr SCI_init

 

Can anyone tell me how to use 12Mhz external crystal/12Mhz Buscklock(or more)?

 

Thanks!

 

 

Outcomes