diff --git a/designFiles/Gerber.zip b/designFiles/Gerber.zip new file mode 100644 index 0000000..a367794 Binary files /dev/null and b/designFiles/Gerber.zip differ diff --git a/designFiles/NCDrill.zip b/designFiles/NCDrill.zip new file mode 100644 index 0000000..7283cc6 Binary files /dev/null and b/designFiles/NCDrill.zip differ diff --git a/main.c b/main.c new file mode 100644 index 0000000..93b8674 --- /dev/null +++ b/main.c @@ -0,0 +1,78 @@ +#include + + +char lec=0; +int cont1=0,cont2=0,cont3=0,cont4=0; +void main(void) +{ + WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer + PM5CTL0 = 0x0000;// DESACTIVAR EL MODO DE ALTA IMPEDANCIA + + /*Confg. de perifericos */ + P1SEL0 = 0x00; + P1SEL1 = 0x00; //SELECCIONAMOS FUNCION COMO I/O DIGITAL + P1DIR = 0x01; //P1.0-> SALIDA P1.1-P1.7-> ENTRADAS + P1REN = 0xFE; + P1OUT = 0xFE; + P1IE = 0x7E; + P1IES = 0x00; + P1IFG = 0x00; + + P9SEL0 = 0x00; + P9SEL1 = 0x00; //SELECCIONAMOS FUNCION COMO I/O DIGITAL + P9DIR = 0x80; //P9.7-> SALIDA P9.0-P9.6->ENTRADAS + P9REN = 0x7f; + P9OUT = 0x00; + + __enable_interrupt(); //tambiƩn se puede usar _enable_interrupts() + + for(;;) + { + + + }//loop +}//main + +//**************Interruptions************** +#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) +#pragma vector=PORT1_VECTOR +__interrupt void inter_puerto1(void) +#elif defined(__GNUC__) +void __attribute__ ((interrupt(PORT1_VECTOR))) PORT1_ISR (void) +#else +#error Compiler not supported! +#endif +{ + + lec=P1IFG; + lec &= BIT3; + __delay_cycles(250); + if( P1IFG == BIT3){ + cont1++; + P1OUT ^= 0x01; + } + + lec &= BIT4; + __delay_cycles(250); + if( P1IFG == BIT4){ + cont2++; + P9OUT ^= 0x80; + } + + lec &= BIT5; + __delay_cycles(250); + if( P1IFG == BIT5){ + cont3++; + P1OUT ^= 0x01; + } + + lec &= BIT6; + __delay_cycles(250); + if( P1IFG == BIT6){ + cont4++; + P9OUT ^= 0x80; + } + + P1IFG=0x00; +} +