Jump to content
43oh

shaharl2

Members
  • Content Count

    2
  • Joined

  • Last visited

About shaharl2

  • Rank
    Noob Class

Profile Information

  • Location
    Germany
  1. Thanks for the comments. I got it working with reading the pins state (PxIN) withing the ISR instead of reading the interrupt flags (PxIFG), as roadrunner84 suggested. in this manner: #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { switch (random){ case 1: // logic gate "AND" if((P1IN & 0x88) == 0x88){ P1OUT |= 0x10; // set "TRUE" LED at P1.4 ON P1OUT &= ~0x20; // set "FALSE" LED at P1.5 OFF } else{ P1OUT |= 0x20; // set "FALSE" LED at P1.5 ON P1OUT &= ~0x10; // set "TRUE" LED at P1.4 OFF } break; case 2
  2. Hi, I am trying to write a code on the launchpad msp430g2553, which would simulate the output of several simple logic gates. I have connected 2 push buttons as inputs to pins P1.3 and P1.7 and 4 LEDs as outputs to P1.0, P1.4, P1.5, and P1.6. 2 of the LEDs are representing the "truth" and "false" of the truth table and the other 2 are just to indicate that a push button has been pressed (1 for each). At first I did it with polling with 6 diferrent logic gates in switch cases and it is working just fine. logicPolling.c But now I am trying to do it with interrupts and I get problems w
×
×
  • Create New...