A follow up. I have been playing with the DCO, writing different values in the DCOTUNE bitfield and got some quite strange results. When the DCOTUNE is zero - everything is fine, the DCO works at its chosen central frequency. When the DCOTUNE has the minimum value (0x200) everything is also fine - the DCO slows down. Now some weird things: when the DCOTUNE=0x1FF, which is (am I wrong?) the greatest positive value, the DCO is really slow, but when I write 0x0FF, the DCO works at its quickest. Now even more weird things. When DCOTUNE=0x144, the DCO is insanely fast for some reason, but when I write 0x145, it becomes extremely slow... I am totally stupefied. Here are the screenshots and a simple main code: int main(void){ int i=0; WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // Stop watchdog timer //Preparing Pins p4.3&4 for MCLK and HSMCLK output P4SEL1=0; P4SEL0=0x18; P4DIR|=0x18; //P4.3&4 = outputs CSACC=CSKEY; //unlocking CS system registers CSCTL0=(1 0;i--){} //Wait CSCTL0=((0x0FF)|(1<<23)); CSCTL0=((0x200)|(1<<23)); CSCTL0=((0x1FF)|(1<<23)); CSCTL0=((0x145)|(1<<23)); CSCTL0=((0x144)|(1<<23)); CSCTL1=(0x3)|(0x3<<4); //Sourcing HSMCLK&MCLK from DCO }
↧