1234567891011121314151617181920212223242526272829 |
- #include <msp430g2553.h>
- void main(void) {
- WDTCTL = WDTPW + WDTHOLD; //desactiver le watchdog
- P1DIR |= 0x41; //passage de p1.0 et p1.6 en sortie
- P1OUT &= ~0x41; //on met les 2 sorties a 0
- P1REN |= BIT3;
- P1IE |= BIT3; //P1.3 activer interruption
- P1IFG &= ~BIT3; //P1.3 IFG cleared
- __enable_interrupt();
- }
- // Port 1 interrupt service routine
- #pragma vector=PORT1_VECTOR
- __interrupt void Port_1(void)
- {
- P1OUT ^= 0x41; // P1.0 = toggle
- P1IFG &= ~BIT3; // P1.3 IFG cleared
- P1IES ^= BIT3; // toggle the interrupt edge,
- // the interrupt vector will be called
- //when P1.3 goes from HitoLow as well as LowtoHigh
- }
|