Sai Chun TANG

HCS08 External Clock Problem

Discussion created by Sai Chun TANG on Dec 8, 2010
Latest reply on Dec 14, 2010 by Sai Chun TANG

Hello,

I am going to test HCS08QG with a 10MHz external oscillator (Murata CSTCE10M0G55 Resonator) .

However I found the bus frequency is 9.118MHz by measuring the pulse width of PTA0.

I also found that CLKST = 00 (Output of FLL is selected.)

I am wondering whether the code or the hardware has problem. I also tried to remove the resonator, but the bus frequency is the same.

The complete code of the external clock test is following:

******************************************************************************************

            INCLUDE 'derivative.inc'
            XDEF _Startup
            ABSENTRY _Startup
            ORG    RAMStart
            ORG    ROMStart
_Startup:
            LDHX   #RAMEnd+1        ; initialize the stack pointer
            TXS
            CLI                     ; enable interrupts
Initialization:
      LDA #%01000000                         ;disable COP and STOP
      STA SOPT1                                     ;disable COP and STOP
      MOV #%10000000,ICSC1            ;Select External Clock
      MOV #%00111100,ICSC2            ;Select External Clock
Port_Init:
      MOV #%11111111,PTADD           ;Set PTA Data Direction          
      MOV #%11111111,PTBDD           ;Set PTB Data Direction
mainLoop:
      MOV #%00000001,PTAD   ;Set PTA0=1
      MOV #%00000000,PTAD   ;Set PTA0=0
      MOV ICSSC,PTBD        ;Move ICSSC to PTBD
      MOV #%00000000,PTBD   ;Set PTB=$00
      BRA mainLoop       
spurious:                           ; placed here so that security value
            NOP                     ; does not change all the time.
            RTI

            ORG   $FFFA
            DC.W  spurious          ;
            DC.W  spurious          ; SWI
            DC.W  _Startup          ; Reset
******************************************************************************************

 

Please advise.

Thanks

sctang

Outcomes