Other Parts Discussed in Thread: MSP430F5529, , MSP430WARE
OK - I've obviously missed something.
On the MSP430F5529 development board, I'm enabled the external XT2 crystal @ 4MHz, and switched to that. Now trying to enable the UART that goes out via the USB connection. My code:
// now set up USCI_A1 // disable USCI A1 HWREGB( USCI_A1_BASE | UCAxCTL1 ) |= UCSWRST; // Clock source SMCLK HWREGB( USCI_A1_BASE | UCAxCTL1 ) = (HWREGB( USCI_A1_BASE | UCAxCTL1 )&0x3f)|0x80; // Configure UART // No Parity 0xc0 = 00 // LSB first 0x20 = 0 // UC7BIT = 8bit 0x10 = 0 // One Stop bit 0x08 = 0 // USCI mode = UART mode 0x06 = 00 // Sync = async 0x01 = 0 HWREGB( USCI_A1_BASE | UCAxCTL0 ) = 0x00; // 11520 baud params for 4MHz Clock // Prescalar = 2 HWREGW( USCI_A1_BASE | UCAxBRW ) = 2; // First Modulation (0xf0) = 2 // Second Modulation (0x0e) = 3 // Oversampling (0x01) = 1 HWREGW( USCI_A1_BASE | UCAxMCTL ) = 0x20|0x06|0x01; // disable interupts HWREGB( USCI_A1_BASE | UCAxIE ) = 0x00; // test going into SEL mode on P4.4 and P4.5 HWREGB( P4_BASE | PxSEL ) |= BIT4|BIT5; // Set P4.4 TX as output // HWREGB( P4_BASE | PxDIR ) |= BIT4; // Set P4.5 RX as input // HWREGB( P4_BASE | PxDIR ) &= ~BIT5; // enable USCI A1 HWREGB( USCI_A1_BASE | UCAxCTL1 ) &= ~UCSWRST; char *string="We are go\n\0"; char *idx=string; while (*idx!=0) { while ((HWREGB( USCI_A1_BASE | UCAxIFG )&UCTXIFG)==0); HWREGB( USCI_A1_BASE | UCAxTXBUF )=*idx++; }
On the computer connected to it - I write the code via /dev/ttyACM0 - so I assume thats the programming interface. The other serial device that is set up is /dev/ttyACM1 - and I'm listening to that port at 115200 baud. But I don't see the message. The rest of the code does run, which sets a led flashing - so the code above is all clearly run.
So question is what have I failed to set to see the output on the UART?