This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I am trying to send a packet using the SPI communication. But when i am switch from first if condition to the second if condition i am facing a isr_trap error. Please drop your insights on this error.Thanks in advance
#include <msp430.h> #include <stdio.h> #include <stdint.h> void init_SPI() { UCB1CTLW0 |=UCSWRST; UCB1CTLW0 &=~UCMSB; UCB1CTLW0 |=UCMST; UCB1CTLW0 |=UCMODE0; UCB1CTLW0 |= UCSSEL__SMCLK; UCB1BRW =10; P5SEL0 |= BIT0 | BIT1 | BIT2; PM5CTL0 &=~LOCKLPM5; UCB1CTLW0 &=~UCSWRST; UCB1IE |=~UCTXIE; __bis_SR_register(GIE); } /** * main.c */ void main(void) { WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer int i=0; init_SPI(); while(1) { if(UCB1IFG & UCTXIFG0) { UCB1TXBUF |=0X4D; } if(UCB1IFG & UCTXIFG0) { UCB1TXBUF |=0X5D; } if(UCB1IFG & UCTXIFG0) { UCB1TXBUF |=0X6D; } } }
Hello,
If you are getting into a trap ISR, this typically means you are enabling an ISR without it being addressed in code. This may or may not be related to the exact peripheral you are using.
Please look at the following resources to help with your SPI debug efforts:
Standard code examples for both Controller (formally master) and Peripheral (formally slave) modes can be found here:
Controller: https://dev.ti.com/tirex/explore/node?node=ACHFXHTiNG.iukEIl1BQ2w__IOGqZri__LATEST
Peripheral: https://dev.ti.com/tirex/explore/node?node=ALko.Ii5r1Btorip0B2uYA__IOGqZri__LATEST
Application note on debugging common issues: www.ti.com/lit/slaa734
MSP Academy walking through SPI concepts and connections: https://dev.ti.com/tirex/explore/node?node=ABoxItVDFGQ-S53Y9G-OHg__IOGqZri__LATEST
Thanks jace.Now i sorted out my issue. i just have to delete these two lines
UCB1IE |=~UCTXIE; __bis_SR_register(GIE);
**Attention** This is a public forum