ai sành msp430 giúp em vơi sửa lỗi là: nguồn xung clock chưa xác định
#include <msp430F1101.h>
int dem1,dem2;
void setuptimer(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P1DIR|= 0x3F;
TACTL=TASSEL_2 + MC_2 + TAIE;
DCOCTL=0x60;
BCSCTL1=0x80;
TACCTL1=CCIE;
CCR1=100;
_BIS_SR(LPM1_bits + GIE);}
void thuattoan(void)
{
dem1=0;
dem2=0;
{
if(P1IN==0xC0)
dem1++;
dem2++;
}
}
void main(void)
{
setuptimer();
thuattoan();
if(dem1>dem2)
P1OUT=0x30;
if(dem1<dem2)
P2OUT=0x14;
}
#include <msp430F1101.h>
int dem1,dem2;
void setuptimer(void)
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P1DIR|= 0x3F;
TACTL=TASSEL_2 + MC_2 + TAIE;
DCOCTL=0x60;
BCSCTL1=0x80;
TACCTL1=CCIE;
CCR1=100;
_BIS_SR(LPM1_bits + GIE);}
void thuattoan(void)
{
dem1=0;
dem2=0;
{
if(P1IN==0xC0)
dem1++;
dem2++;
}
}
void main(void)
{
setuptimer();
thuattoan();
if(dem1>dem2)
P1OUT=0x30;
if(dem1<dem2)
P2OUT=0x14;
}
Comment