1172 views|0 replies

3836

Posts

19

Resources
The OP
 

430 MCU driver [Copy link]

#include
int main(void)
{
  WDTCTL| = WDTPW + WDTHOLD;                 // Stop WDT
  BCSCTL2|=SELS;
  P1SEL|=0X02;
  P1DIR |= 0x08;                            // P1.2 and P1.3 output
  CCTL0|=CM_1+SCS+CAP+CCIE;
  TACTL|= TASSEL_2 + MC_2+TAIE;                  // SMCLK, up-down mode
   _EINT();
while(1);
}
#pragma vector=TIMERA0_VECTOR
__interrupt void TimerA0(void)
{
if(TACCTL0&CM1)
{P1OUT&=~0X08;
TACCTL0|=CM_1+SCS+CAP+CCIE;
}
else if(TACCTL0&CM0)
{P1OUT|=0X08;
TACCTL0=CM_2+SCS+CAP+CCIE;
}
}

This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list