It is kind of hard to visualize what the code does unless one is very very familar with how that part of the msp430 operates.
the best way is to hook an oscilliscope up to the pin to verify the correct operation. On Mon, Feb 10, 2014 at 10:13 AM, Mehmet Fatih <[email protected]>wrote: > Hi, > > I have this low-level code for telosb (msp430): > > WDTCTL = WDTPW + WDTHOLD; // Watchdog canceled > P2DIR |= BIT4; // P2.4 is output > P2SEL |= BIT4; // P2.4 is TA2 function output > > TACCR0 = 24; // If timer incremented at 500khz, then period is 24 > to get 40khz > TACCR2 = 12; // Half of period 1, half 0 > > TACCTL2 = OUTMOD_3; // OUT=1 when counting to TACCR1 value. OUT=0 when > counting to TACCR0 value. > > TACTL = TASSEL_2 + ID_3 + MC_1; // SMCLK=(4mhz), DIV_8=(4mhz/8=500khz), > UP_MODE=(counts to TACCR0) > > I pretend to generate 40khz square wave on Port 2.4. Am I correct? > > Thanks > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Eric B. Decker Senior (over 50 :-) Researcher
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
