Closed elliotmatson closed 11 years ago
I gave this some thought and since most users will not have an external XTAL hooked up I am going to leave it as it is. If external XTAL needs to be used then it will have to be enabled in code (e.g. P2.6/P2.7 need to be set to XTAL and ACLOCK needs to be set to external XTAL). I have just pushed a commit that sets P2.6/P2.7 default to GPIO.
I have code in CCS that uses the external crystal to toggle an LED once per second using the external crystal. The same code (with necessary modifications) in Energia doesn't use the external crystal and instead used the internal 12khz oscillator. I am using a 2553
CCS Code: ---_--_--_-_---_--_-_---_--_-_---_--_-_---_-_--_--_ /**
include
unsigned int currentMinutes, currentSeconds;
void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT
}
// Timer A0 interrupt service routine
pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void) { P1OUT ^= BIT0; // Toggle LED }
---_--_--_-_---_--_-_---_--_-_---_--_-_----
Energia code: ---_--_--_-_---_--_-_---_--_-_---_--_-_---- /**
void setup() {}
void loop() { WDTCTL = WDTPW + WDTHOLD; // Stop WDT
}
pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void) { P1OUT ^= BIT0; // Toggle LED }
---_--_--_-_---_--_-_---_--_-_---_--_-_----