Other Parts Discussed in Thread: MSP-FET
I have the MSP-FET USB programmer connected via JTAG to the EM-CC430F6137. I used this sample code for a basic UART test:
#include <cc430f6137.h> /** * main.c */ void main(void) { // Set UART (UCA0CTL0 & UCA0CTL1) //1. Always set the UCSWRST before setting the USCI module UCA0CTL1 |= UCSWRST; UCA0CTL1 |= UCSSEL_2; // Use SMCLK as clock src // Set Baud rate UCA0BR0 = 9; // Low bit of UCBRx is 9 UCA0BR1 = 0; // High bit of UCBRx is 0 UCA0MCTL |= UCBRS_1 + UCBRS_0; // Second stage modulation is 1 (9600 bauds) //UCA0STAT = UCLISTEN; // Enable internal loop-back //2. Clear UCSWRST UCA0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation //3. Enable UART TX & RX interrupts UCA0IE |= UCRXEIE | UCTXIE; _enable_interrupts(); //LPM0; } // USCI A transmitter interrupt #pragma vector=USCI_A0_VECTOR __interrupt void USCIA0TX_ISR(void) { switch(UCA0IV, 4) { case 0:break; case 2: while(!(UCA0IFG & UCTXIFG)); // Wait on the buffer UCA0TXBUF = UCA0RXBUF; break; case 4:break; default:break; } }
When I connect to the IDE's serial terminal I get back some strange output:
I figured, this must be coming from the debugger, because when I remove the JTAG cable from the EMCC430F6137 board I still get these results.
Another thing I've tried is to add these lines of code to the code above:
... P1DIR |= BIT6; // set P1.6 as TX P1SEL|= BIT5 + BIT6; // select P1.5 & P1.6 to UART function ...
and then I tried using a TLL serial cable along with the *NIX program "screen" @ a baud-rate of 115200 (as shown in the picture below)
This second method doesn't work either. I get no output from the board.
What am I missing?