summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Knispel <gknispel@avencall.com>2012-08-23 17:54:45 +0200
committerGuillaume Knispel <gknispel@avencall.com>2012-08-23 17:54:45 +0200
commit8d97422b552f37459c766ee11dbc3b8164a75b8c (patch)
tree7b15c6183e6ef0b85b1120366ebc5db63bdcdab1
parentd67be076e7af0a5d71b1eb8bc869637eb72b9ce4 (diff)
switch to 12MHz SMCLK
-rwxr-xr-x[-rw-r--r--]main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/main.c b/main.c
index 35b3ade..ce22aa1 100644..100755
--- a/main.c
+++ b/main.c
@@ -297,7 +297,6 @@ static void GlobalInit(void)
{
DCOCTL = CALDCO_12MHZ;
BCSCTL1 = CALBC1_12MHZ;
- BCSCTL2 |= DIVS_3; // DIVS_3 => 1/8; SMCLK = 12/8 = 1.5Mhz
TACTL = TASSEL_2 + ID_3 + TACLR + TAIE + MC_1; // SMCLK + div by 8 + reset +
// enable interrupt + UP
@@ -309,13 +308,14 @@ static void GlobalInit(void)
// 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;
+ // Timer_A called every:
+ //
+ // >>> 1539 / 1500000. * .975
+ // 0.00100035 1.000 ms min
+ // >>> 1539 / 1500000.
+ // 0.001026 1.026 ms nom
+ // >>> 1539 / 1500000. * 1.025
+ // 0.00105165 1.052 ms max
+
+ TACCR0 = 1539;
}