diff options
author | Guillaume Knispel <gknispel@avencall.com> | 2012-08-22 15:57:04 +0200 |
---|---|---|
committer | Guillaume Knispel <gknispel@avencall.com> | 2012-08-22 15:57:04 +0200 |
commit | 65db50051fb2fe26cc3580f81b3d94bd4d5ec1d5 (patch) | |
tree | b1ca2397c82786dbc80bbb01c8ae19972e54c1a5 | |
parent | 9dc6c28545daf15e8f7e67e5fa9b5cf6730a0585 (diff) |
some timing and power led adjustments
-rw-r--r-- | main.c | 32 |
1 files changed, 20 insertions, 12 deletions
@@ -149,7 +149,7 @@ int main(void) case WAIT_RSMRST: if (SW1State) state = STOP; - if (Timer1 < 20) { + if (Timer1 < 19) { SetBit(P2OUT, IMCH_RSMRST_N); state = WAIT_V1P8; } @@ -180,7 +180,7 @@ int main(void) if (Timer1 == 0) { SetBit(P2DIR, CK410_PWR_GD_N); ClrBit(P2OUT, CK410_PWR_GD_N); - Timer1 = 110; + Timer1 = 105; state = STATE_SYS_PWR_OK; } break; @@ -215,22 +215,17 @@ int main(void) break; case WAIT_STOP: - if (SW1State >= 6000) // Sw1 button pressed for more than 6 secondes + if (SW1State >= 6000) // Sw1 button pressed for more than 6 seconds state = STOP; break; case STOP: InitPorts(); - Timer1 = 10000; // Disable any other Power up for 10s. - // We are very careful at first but we know no reason why this should - // not work with an extremely lower timer. Under some conditions ATX - // imposes debouncing up to at least 100 ms. I guess a good compromise - // would be somewhere between 0.5 to 1s. + Timer1 = 500; // Disable any other Power up for 0.5 s. ClrBit(P2OUT, RED_LED_N); // To show no restart is possible for now state = STOP + 1; break; case STOP + 1: - InitPorts(); if (Timer1 == 0) { SetBit(P2OUT, RED_LED_N); // To show restart is possible now state = WAIT_START; @@ -304,10 +299,23 @@ static void GlobalInit(void) BCSCTL1 = CALBC1_12MHZ; BCSCTL2 |= DIVS_3; // DIVS_3 => 1/8; SMCLK = 12/8 = 1.5Mhz - // Set timer A so that Timer_A is called every 1.00266 ms (nominal) TACTL = TASSEL_2 + ID_3 + TACLR + TAIE + MC_1; // SMCLK + divise 8 + reset + // enable intterupt + UP - // 188/187500.0 = 0.001002666666666666 - TACCR0 = 188; + // Calibrated DCO Frequencies - Tolerance Over Temperature 0C to 85C + // + // Min Typ Max + // BCSCTL1 = CALBC1_12MHZ, 2.2 V 11.7 12 12.3 + // fCAL(12MHz) DCOCTL = CALDCO_12MHZ, 3 V 11.7 12 12.3 MHz + // Gating time: 5 ms 3.6 V 11.7 12 12.3 + + + // Set timer A so that Timer_A is called every [1.0036; 1.0551] ms + // >>> 193/187500. * 0.975 + // 0.0010035999999999999 1.0036 ms min + // >>> 193/187500. + // 0.0010293333333333333 1.0293 ms nom + // >>> 193/187500. * 1.025 + // 0.0010550666666666664 1.0551 ms max + TACCR0 = 193; } |