2.2.2 “Disable Clock Source” Command Remains Enabled

In the dynamic clock switch module, the ‘disable clock source’ command remains running after disabling the targeted clock source (the clock source is set in the CLKSELR register).

Work Around

After a ‘disable clock source’ command, reset the CLKCSR register by writing 0x80.

Code example:

        ; Select crystal oscillator
                ldi temp1,(0x0F<<CSEL0)
                sts CLKSELR, temp1
        ; Disable clock source (crystal oscillator)
                ldi temp2,(1<<CLKCCE)
                ldi temp3,(0x01<<CLKC0) ; CSEL = "0001"
                sts CLKCSR,temp2 ; Enable CLKCSR register access
                sts CLKCSR,temp3 ; (*) Disable crystal oscillator clock
        ; (*) !!! At this moment, if any other clock source is selected by CLKSELR,
        ; this clock source will also stop !!!
        ; ==> WORKAROUND ...
                sts CLKCSR,temp2        

Affected Silicon Revisions

Rev. ARev. BRev. C
XXX