HDD GURU FORUMS http://forum.hddguru.com/ |
|
Can MSP430F2418 Change the Clock Source of ACLK http://forum.hddguru.com/viewtopic.php?f=7&t=35423 |
Page 1 of 1 |
Author: | ailex1995 [ June 1st, 2017, 5:35 ] |
Post subject: | Can MSP430F2418 Change the Clock Source of ACLK |
Good day, The MCU is MSP430F2418 which I bought from site: [spam link removed] and at the beginnning, clock source is serve as VLO in MCU inside. I want to change the clock source of ACLK to be crystal oscillator--32768 outside when operating. The code is given below: Code: #include "msp430.h" void main(void) { unsigned long i=0xffff; _BIC_SR(0xFFFF); //reset anything in SR, inline function. WDTCTL=WDTPW+WDTHOLD; //colse watchdog timer BCSCTL1&=~XT2OFF; /open XT2 BCSCTL2 |= (SELM_2+DIVM_2+SELS); //MCLK、SMCLK choose xt2(5MHz,so MCLK=1.25MHz,SMCLK=5MHz BCSCTL3 |= (XT2S_2+LFXT1S_2+XCAP_1); //6pF capacitor IFG1 &= ~OFIFG; P5SEL |= BIT4+BIT6; P5DIR |= BIT4+BIT6; P1SEL |= BIT4; P1DIR |= BIT4; IFG1&=~(WDTIFG+OFIFG+NMIIFG+PORIFG+RSTIFG); //Interrupt flag reset FCTL3=FWKEY; //ACCVIFG reset IE1|=OFIE+NMIIE+ACCVIE; //Interrupt initialization Settings while(i) { i--; } BCSCTL3 = (XT2S_2+LFXT1S_0+XCAP_1); do { IFG1 &= ~OFIFG; // Clear OSCFault flag for (i = 0xFF; i > 0; i--); // Time for flag to set } while (IFG1 & OFIFG); // OSCFault flag still set while(1); } The programs,However, always lies in these code “ while(i) { i--;}”. When I deleted the sentence “BCSCTL3 = (XT2S_2+LFXT1S_0+XCAP_1);”, it can operate normally again ! ! ! Why? Best regards~ |
Author: | jermy [ June 1st, 2017, 10:47 ] |
Post subject: | Re: Can MSP430F2418 Change the Clock Source of ACLK |
I dont know what this has to do with HDDs (I really dont care) And I really dont know who has written the code but the code makes no sense "at all" |
Author: | fzabkar [ June 1st, 2017, 14:28 ] |
Post subject: | Re: Can MSP430F2418 Change the Clock Source of ACLK |
jermy wrote: I dont know what this has to do with HDDs (I really dont care) The MSP430 is used as a power controller/sequencer in some SSDs. |
Author: | Cervisia [ June 2nd, 2017, 12:01 ] |
Post subject: | Re: Can MSP430F2418 Change the Clock Source of ACLK |
But the F2418 would not make sense in this application. This is an attempt at https://xkcd.com/810/ . |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |