|
Prev: Brand Watches Orient Cer1a002w Automatic Divers Mens Watch Discount, Replica, Fake
Next: Longines Ladies Watches Presence L4.220.2.12.2 - AA - Replica Watch Fake
From: Oskar on 21 Apr 2008 13:10 Hi, I'm trying to clock the CPU (MSP430F1611) to 8,000,000 Hz and I've run into some problems. Making the CPU to actually run at 8MHz was easy enough: DCOCTL = DCO0 + DCO1 + DCO2; /* 0xE0 */ BCSCTL1 = XT2OFF + RSEL0 + RSEL1 + RSEL2; /* 0x87 */ However, the UART1 stopped working. What I've got so far is: void uart1_init( unsigned int ubr ) { /* RS232 */ P3DIR &= ~0x80; /* Select P37 for input (UART1RX) */ P3DIR |= 0x40; /* Select P36 for output (UART1TX) */ P3SEL |= 0xC0; /* Select P36,P37 for UART1{TX,RX} */ UCTL1 = SWRST | CHAR; /* 8-bit character, UART mode */ U1RCTL &= ~URXEIE; /* even erroneous characters trigger interrupts */ UTCTL1 = SSEL1; /* UCLK = MCLK */ /* ubr is 8000000/baud */ UBR01 = ubr; /* assuming 19200 bps: UBR01 = 0xA0; */ UBR11 = ubr >> 8; /* assuming 19200 bps: UBR11 = 0x01; */ /* UMCTL1 calculated using http://mspgcc.sourceforge.net/baudrate.html */ UMCTL = 0x5B; /* assuming 19200 bps */ ME2 &= ~USPIE1; /* USART1 SPI module disable */ ME2 |= ( UTXE1 | URXE1 ); /* Enable USART1 TXD/RXD */ UCTL1 &= ~SWRST; IE2 |= URXIE1; /* Enable USART1 RX interrupt */ } What am I missing here? Any help appreciated! -- Oskar |