Thank you for your quick answer. I've looked at the Driverlib code and tried to replicate it in my code (I'm trying to avoid using driverlib for the time being). I've replaced my wait cycle between each byte with the correct loop. I've also added the UCTXSTP command at the end of my ISR, but LEDs still stay off. In this case, is it safe to assume that the problem isn't from the ISR? I've written my new ISR below. It still sends the same 4 bytes before sending a STOP command. Thank you for your time. #pragma vector = USCI_B0_VECTOR __interrupt void USCI_B0_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(USCI_B0_VECTOR))) USCI_B0_ISR (void) #else #error Compiler not supported! #endif { switch(__even_in_range(UCB0IV,12)) { case 0: break; // Vector 0: No interrupts case 2: break; // Vector 2: ALIFG case 4: break; // Vector 4: NACKIFG case 6: // Vector 6: STTIFG { UCB0IFG &= ~UCSTTIFG; // Clear start condition int flag break; } case 8: // Vector 8: STPIFG UCB0IFG &= ~UCSTPIFG; // Clear stop condition int flag __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 if data was transmitted break; case 10: break; // Vector 10: RXIFG case 12: // Vector 12: TXIFG { UCB0IE &= ~UCTXIE; for (i =0;i<4;i++) { if(i==0 ||i==2) __delay_cycles(10000); // Pause between byte groups to see LEDs flicker UCB0TXBUF = TxData[i]; while(!(UCB0IFG & UCTXIFG)); } UCB0CTL1 |= UCTXSTP; UCB0IFG &= ~UCTXIFG; UCB0IE |= UCTXIE; break; } default: break; } }
↧