Search results

  1. thanh xuân

    capture

    #include <msp430.h> unsigned int dau=0,i=0; unsigned int a[]={0,0,0,0}; void setup_timer(){ TA0CTL=TASSEL_2+ID_3+MC_2+TAIE; TA0CCTL0 = CM_3 + CCIS_0 + CAP + CCIE+ SCS; } void setup_port(){ // CCI1A -> P1.1 (datasheet) P1SEL |= BIT1; P1SEL2 &= ~BIT1; P1DIR &= ~BIT1...
  2. thanh xuân

    [C12] Thông báo buổi học 16-11

    #include <msp430.h> /* * main.c */ void setup_timer(void){ TA0CTL=TASSEL_2+MC_2+ID_3+TAIE+TACLR; TA0CCR0=6250; TA0CCTL0=CCIE; } void setup_port(void){ P2SEL=0; P2SEL2=0; P2DIR=BIT0+BIT7; P2OUT=BIT0+BIT7; } void main(void) { WDTCTL = WDTPW | WDTHOLD;// Stop watchdog timer setup_timer()...
  3. thanh xuân

    [C12] Thông báo buổi học 16-11

    #include <msp430.h> /* * main.c */ void setup_timer(void){ TA0CTL=TASSEL_2+MC_2+ID_3+TAIE+TACLR; TA0CCR0=62500; TA0CCTL0=CCIE; } void setup_port(void){ P2SEL=0; P2SEL2=0; P2DIR=BIT0+BIT7; P2OUT=BIT0; } void main(void) { WDTCTL = WDTPW | WDTHOLD;// Stop watchdog timer setup_timer()...
Top