Added Teensy3.1 32KHz MCU loading capacitors.

External loading capacitors not fitted to the Teensy3.1 PCB, Added 20pF MCU loading capacitors for 32KHz crystal.
pull/957/head
Paul Staron 2015-03-07 22:49:02 +00:00
parent e027a8e224
commit 2dfb1b743f
1 changed files with 7 additions and 1 deletions

View File

@ -29,9 +29,15 @@ static void init(void) {
void rtc_init(void) { void rtc_init(void) {
init(); init();
// Enable the oscillator // Enable the oscillator
#if defined (TARGET_K20D50M)
RTC->CR |= RTC_CR_OSCE_MASK; RTC->CR |= RTC_CR_OSCE_MASK;
#else
// Teensy3.1 requires 20pF MCU loading capacitors for 32KHz RTC oscillator
/* RTC->CR: SC2P=0,SC4P=1,SC8P=0,SC16P=1,CLKO=0,OSCE=1,UM=0,SUP=0,SPE=0,SWR=0 */
RTC->CR |= RTC_CR_OSCE_MASK |RTC_CR_SC16P_MASK | RTC_CR_SC4P_MASK;
#endif
//Configure the TSR. default value: 1 //Configure the TSR. default value: 1
RTC->TSR = 1; RTC->TSR = 1;