static void prvSetupHardware( void ) { /* Convert a Hz value to a KHz value, as required by the Init_FLL_Settle() function. */ unsigned long ulCPU_Clock_KHz = ( configCPU_CLOCK_HZ / 1000UL ); halBoardInit(); LFXT_Start( XT1DRIVE_0 ); Init_FLL_Settle( ( unsigned short ) ulCPU_Clock_KHz, 488 ); halButtonsInit( BUTTON_ALL ); halButtonsInterruptEnable( BUTTON_SELECT ); /* Initialise the LCD, but note that the backlight is not used as the library function uses timer A0 to modulate the backlight, and this file defines vApplicationSetupTimerInterrupt() to also use timer A0 to generate the tick interrupt. If the backlight is required, then change either the halLCD library or vApplicationSetupTimerInterrupt() to use a different timer. Timer A1 is used for the run time stats time base6. */ halLcdInit(); halLcdSetContrast( 100 ); halLcdClearScreen(); halLcdPrintLine( " www.FreeRTOS.org", 0, OVERWRITE_TEXT ); }
static void prvSetupHardware( void ) { taskDISABLE_INTERRUPTS(); /* Disable the watchdog. */ WDTCTL = WDTPW + WDTHOLD; halBoardInit(); LFXT_Start( XT1DRIVE_0 ); hal430SetSystemClock( configCPU_CLOCK_HZ, configLFXT_CLOCK_HZ ); hal430SetSubSystemMasterClock( ); halButtonsInit( BUTTON_ALL ); halButtonsInterruptEnable( BUTTON_SELECT ); /* Initialise the LCD, but note that the backlight is not used as the library function uses timer A0 to modulate the backlight, and this file defines vApplicationSetupTimerInterrupt() to also use timer A0 to generate the tick interrupt. If the backlight is required, then change either the halLCD library or vApplicationSetupTimerInterrupt() to use a different timer. Timer A1 is used for the run time stats time base6. */ halLcdInit(); halLcdSetContrast( 100 ); halLcdClearScreen(); halLcdPrintLine( " www.FreeRTOS.org", 0, OVERWRITE_TEXT ); }
void InitTimer(void) { P5SEL |= 0x03; // Set xtal pins LFXT_Start(XT1DRIVE_0); TA0CCR1 = RX_TIMER_PERIOD; // x cycles * 1/32768 = y us TA0CCTL1 = CCIE; // Enable interrupts TA0CTL = TASSEL__ACLK + TACLR; // ACLK source }
//***************************************************************************** // //! initClk //! //! @param None //! //! @return none //! //! @brief Init the device with 16 MHz DCOCLCK. // //***************************************************************************** void initClk(void) { // Set Vcore to accomodate for max. allowed system speed SetVCore(3); // Use 32.768kHz XTAL as reference LFXT_Start(XT1DRIVE_0); // Set system clock to max (25MHz) Init_FLL_Settle(25000, 762); SFRIFG1 = 0; SFRIE1 |= OFIE; }
void SysInit(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer Board_init(); // Basic GPIO initialization SetVCore(3); // Set Vcore to accomodate for max. allowed system speed LFXT_Start(XT1DRIVE_0); // Use 32.768kHz XTAL as reference, ACLK: SELA = 000, DIVA = 000 Init_FLL_Settle(25000, 762); // Set system clock to max (25MHz) LcdInit(); LcdClear(); //display_rect(); AD9954Init(); P4SEL = 0x00; P4DIR = 0x00; P4REN = 0xff; }
//---------------------------------------------------------------------------- VOID Init_Clock(VOID) { #if defined (__MSP430F563x_F663x) while(BAKCTL & LOCKIO) // Unlock XT1 pins for operation BAKCTL &= ~(LOCKIO); // enable XT1 pins // Workaround for USB7 UCSCTL6 &= ~XT1OFF; #endif if (USB_PLL_XT == 2) { #if defined (__MSP430F552x) || defined (__MSP430F550x) P5SEL |= 0x0C; // enable XT2 pins for F5529 #elif defined (__MSP430F563x_F663x) P7SEL |= 0x0C; #endif // Use the REFO oscillator to source the FLL and ACLK UCSCTL3 = (UCSCTL3 & ~(SELREF_7)) | (SELREF__REFOCLK); UCSCTL4 = (UCSCTL4 & ~(SELA_7)) | (SELA__REFOCLK); // MCLK will be driven by the FLL (not by XT2), referenced to the REFO Init_FLL(USB_MCLK_FREQ/1000, USB_MCLK_FREQ/32768); // Start the FLL, at the freq indicated by the config constant USB_MCLK_FREQ //XT2_Start(XT2DRIVE_3); // Start the "USB crystal" } else { #if defined (__MSP430F552x) || defined (__MSP430F550x) P5SEL |= 0x10; // enable XT1 pins #endif // Use the REFO oscillator to source the FLL and ACLK // UCSCTL3 = SELREF__REFOCLK; // UCSCTL4 = (UCSCTL4 & ~(SELA_7)) | (SELA__REFOCLK); P5SEL |= 0x30; // enable XT1 pins for F5509 LFXT_Start(XT1DRIVE_3); // Use the LFXT1 oscillator to source the FLL and ACLK UCSCTL3 = SELA__XT1CLK; UCSCTL4 = (UCSCTL4 & ~(SELA_7)) | (SELA__XT1CLK); // MCLK will be driven by the FLL (not by XT2), referenced to the REFO Init_FLL(USB_MCLK_FREQ/1000, USB_MCLK_FREQ/32768); // set FLL (DCOCLK) //XT1_Start(XT1DRIVE_3); // Start the "USB crystal" } }
static void prvSetupHardware(void) { /* Convert a Hz value to a KHz value, as required by the Init_FLL_Settle() function. */ unsigned long ulCPU_Clock_KHz = (25000000UL / 1000UL ); /* Disable the watchdog. */ WDTCTL = WDTPW + 0x36; SFRIE1 |= WDTIE; /* select port pin functions */ halBoardInit(); LFXT_Start(XT1DRIVE_0); /* enable oszillator */ Init_FLL_Settle((unsigned short) ulCPU_Clock_KHz, 488); /* clock divisor */ }
/*-----------------------------------------------------------*/ static void prvSetupHardware( void ) { taskDISABLE_INTERRUPTS(); /* Disable the watchdog. */ WDTCTL = WDTPW + WDTHOLD; //halBoardInit(); Board_init(); // Set Vcore to accomodate for max. allowed system speed SetVCore(3); // Use 32.768kHz XTAL as reference LFXT_Start(XT1DRIVE_0); // Set system clock to max (25MHz) Init_FLL_Settle(25000, 762); SFRIFG1 = 0; SFRIE1 |= OFIE; //LFXT_Start( XT1DRIVE_0 ); //hal430SetSystemClock( configCPU_CLOCK_HZ, configLFXT_CLOCK_HZ ); //halButtonsInit( BUTTON_ALL ); Buttons_init(BUTTON_ALL); //halButtonsInterruptEnable( BUTTON_SELECT ); Buttons_interruptEnable(BUTTON_S2); /* Initialise the LCD, but note that the backlight is not used as the library function uses timer A0 to modulate the backlight, and this file defines vApplicationSetupTimerInterrupt() to also use timer A0 to generate the tick interrupt. If the backlight is required, then change either the halLCD library or vApplicationSetupTimerInterrupt() to use a different timer. Timer A1 is used for the run time stats time base6. */ //halLcdInit(); //halLcdSetContrast( 100 ); //halLcdClearScreen(); //halLcdPrintLine( " www.FreeRTOS.org", 0, OVERWRITE_TEXT ); }
void UCS_LFXT1Init( ) { //UCS->CTL6 &= ~UCS_CTL6_XT1OFF; LFXT_Start( UCS_CTL6_XT1DRIVE_0 ); }