Walser, Martin wrote:
Hi,
I'm using the MSP430x149. When I try to debug the following line, the debugger
hangs at this point:
The debugger doesn't hang. Your code does.
-> while ((IFG1 & UTXIFG0) == 0); // USART0 TX buffer ready?
TXBUF0 = *pStr++;
The MSP430 UART works differently from most UARTs. Most interrupt simply
becasue the Tx register *is* available, and keep on interrupting until
you disable interrupts or send something. The MSP430 interrupts because
the Tx register *has become* available. This means it doesn't keep
repeating its interrupt. It also means it doesn't interrupt as soon as
you enable interrupts at startup. You actually need to send a character
to kick things off. I found this by hitting problems. It wasn't that
obvious from reading the documentation. Unless you are actually using
interrupts, why not look at the bits in the actual UART registers? The
bits there indicate the true state of the transmitter.
The insight debugger also seems to hang at crystal startup
do // wait in loop until crystal
is stable
{
IFG1 &= ~OFIFG;
-> } while (IFG1 & OFIFG);
Why would you expect this to do anything but loop forever? The interrupt
says there is a problem. You do nothing to fix it.
Regards,
Steve