Skip to content

Commit

Permalink
fixed timer examples
Browse files Browse the repository at this point in the history
  • Loading branch information
chiva committed Apr 24, 2011
1 parent 0994d1c commit 7aab849
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions timrled1.c
@@ -1,7 +1,7 @@
// timrled1.c - toggles LEDs with period of about 1s
// timrled1.c - toggles LEDs with period of about 1.04s
// Poll free-running timer A with period of about 0.52s
// Timer clock is SMCLK divided by 8, continuous mode
// Launchpad v1.3 , LED1,2 active low on P1.0,6
// Launchpad v1.3 , LED1,2 active high on P1.0,6
// J H Davies, 2006-06-12;
// Launchpad port: S Reig, 2011-04-24; Code Composer Studio v4.2.3
// ----------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions timrled2.c
@@ -1,8 +1,8 @@
// timrled1.c - toggles LEDs with period of about 1s
// Poll free-running timer A with period of about 0.52s
// Timer clock is SMCLK divided by 8, continuous mode
// Launchpad v1.3 , LED1,2 active low on P1.0,6
// J H Davies, 2006-06-12;
// timrled2.c - toggles LEDs with period of about 1.0s
// Poll timer A in Up mode with period of about 0.5s
// Timer clock is SMCLK divided by 8, up mode, period 50000
// Launchpad v1.3 , LED1,2 active high on P1.0,6
// J H Davies, 2006-06-16;
// Launchpad port: S Reig, 2011-04-24; Code Composer Studio v4.2.3
// ----------------------------------------------------------------------

Expand All @@ -16,7 +16,7 @@ void main (void) {
WDTCTL = WDTPW|WDTHOLD; // Stop watchdog timer
P1OUT = LED1; // Preload LED1 on , LED2 off
P1DIR = LED1|LED2; // Set pins for LED1 ,2 to output
TACCR0 = 49999; // Upper limit of count for TAR
TACCR0 = 65499; // Upper limit of count for TAR
TACTL = MC_1|ID_3|TASSEL_2|TACLR; // Set up and start Timer A
// "Up to CCR0" mode , divide clock by 8, clock from SMCLK , clear timer
for (;;) { // Loop forever
Expand Down

0 comments on commit 7aab849

Please sign in to comment.