Hi
I want to test my MSP430F5529 launchpad's SPI configuration so I have a code to loopback test. I modified the code provided in the below thread so that it is compliant with my version of MSP430. While debugging, when the control goes into the ISR and exits, I get this message:
No source available for "0x200"
Deassembly code:
Port_1_2_P1IN, Port_A_PAIN: 000200: FDFC 0000 AND.B @R13+,0x0000(R12) Port_1_2_P1DIR, Port_A_PADIR: 000204: 0001 MOVA @PC,SP Port_1_2_P1REN, Port_A_PAREN: 000206: 0000 BRA @PC Port_1_2_P1DS, Port_A_PADS: 000208: 0000 BRA @PC Port_1_2_P1SEL, Port_A_PASEL: 00020a: 0000 BRA @PC 00020c: 0000 BRA @PC
Kindly suggest what could be the issue. Please find my code, pin connections and the actual thread below:
Main code:
#include <msp430.h> void initSPI_USCIA(void); //initializes SPI on USCIB0 for the sd card reader/writer void initLED(void); //initializes led so we can toggle it __interrupt void USCI_B0_ISR(void); void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer //Stop watchdog timer initLED(); initSPI_USCIA(); while (!(UCB0IFG & UCTXIFG)) { //wait for ready to transmit } UCB0TXBUF = 0x11; //writes to spi data register _BIS_SR(LPM4_bits + GIE); // Enter LPM4 w/interrupts enabled } void initSPI_USCIA(void) { UCB0CTL1 |= UCSWRST; //set software reset to 1 so we can configure SPI UCB0STAT |= UCLISTEN; //the launchpad listens to itself (use for testing) UCB0CTL0 |= UCCKPH +UCCKPL+ UCMSB + UCMST + UCSYNC; //clkphase,clkpolarity,MSBfirst,8-bit,master mode, 3-pin, synchronous SPI UCB0CTL1 |= UCSSEL_2; //choose SMCLK as our clock. SMCLK is 1.1 MHz. We divise it with the baud register UCB0BR0 |= 0x02; //Baud rate is 1.1MHZ/(2+1) = 366 KHz UCB0BR1 = 0; //upper byte of br register. set to zero P3SEL |= (BIT0 | BIT1 | BIT2); //configures pins for three pin SPI. MISO P1.1, MOSI P1.2, CLK P1.4 UCB0CTL1 &= ~UCSWRST; //enables the SPI to work UCB0IE |= UCRXIE; // Enable USCI0 RX interrupt } void initLED(void) { P1DIR |= BIT0; //sets red led to output and turns it on P1OUT &= ~BIT0; //turn red led off } #pragma vector=USCI_B0_VECTOR __interrupt void USCI_B0_ISR(void) { if(UCB0RXBUF == 0x11) { P1OUT = 0x01; //turn red led on __delay_cycles(255); P1OUT = 0x00; } else { P1OUT = 0x01; //turn red led on __delay_cycles(255); P1OUT = 0x00; P1OUT = 0x01; //turn red led on __delay_cycles(255); P1OUT = 0x00; } }
PIN CONFIGURATION
P3.0 -->MOSI --> CONNECTED TO MISO
P3.1 -->MISO -->CONNECTED TO MOSI
P3.2 -->SCLK (not connected to anything)
Reference thread
Please suggest some solutions.
Thanks,