Jump to content

Kevink

Members
  • Content Count

    12
  • Joined

  • Last visited

  1. Murphy, a life long close personal friend of mine was with me today. The problem with my serial rx side of things was a blown Port 3 pin 5. I know this because I set all of port3 to toggle state and every pin on the port did but pin 5. Pin 5 is stuck high. I tried another board and all is good on that pin anyway... And now I get serial out! Thanks to those that tried to help me Kevin
  2. TI example fet140_uart01_19200_2.c Well after looking a little deeper I see there is a better TI serial port example for me to try, It's better because is uses XT2 as does my board. The only difference is that I need to change the xtal freq from 8MHz as in the example to 6 MHz as in my board. I changed my baud rate of my termina to 19200 as in the example and I changed UBR00 = 0xA0; // 8Mhz/19200 ~ 417 UBR10 = 0x01; // UMCTL0 = 0x00; // no modulation to my setup: UBR00 = 0x38; // 6Mhz/19200 ~ 312 UBR10 = 0x01; // UMCTL0 = 0x00; // no modulation And still no output...
  3. Are there any hopes in getting Energia support for this old chip, the msp430f149? I could really use it for it's serial port! Kevin
  4. Hello Spirilis the line: UTCTL0 |= SSEL0; // UCLK = ACLK Is a TI original line but that might be clashing with my changes to the source of the clock... Any ideas on how to fix it? Kevin
  5. UBR00 and UBR10 were changed as per a calculator for 6 MHz. and 9600 baud.
  6. I feel closer but... Still nothing comes out of the tx port as viewed by scope. Here is my code. It is the TI fet140_uart01_9600.c changed by me to use the 6MHz xtal on XT2. /* --COPYRIGHT--,BSD_EX * --/COPYRIGHT--*/ //****************************************************************************** // MSP-FET430P140 Demo - USART0, UART 9600 Echo ISR, HF XTAL ACLK // // Description: Echo a received character, RX ISR used. Normal mode is LPM0, // USART0 RX interrupt triggers TX Echo. Though not required, MCLK = LFXT1 // ACLK = MCLK = UCLK0 = LFXT1 = 3.58MHz // Baud rate divider with 3.58Mhz XTAL @9600 = 3.58MHz/9600 = 372 (0174h) // //* An external 3.58Mhz XTAL on XIN XOUT is required for ACLK *// // // MSP430F149 // ----------------- // /|\| XIN|- // | | | 3.58MHz // --|RST XOUT|- // | | // | P3.4|------------> // | | 9600 - 8N1 // | P3.5|<------------ // // // M. Buccini // Texas Instruments Inc. // Feb 2005 // Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A //****************************************************************************** #include <msp430.h> int main(void) { volatile unsigned int i; WDTCTL = WDTPW + WDTHOLD; // Stop WDT P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD BCSCTL1 &= ~XT2OFF; // XT2= HF XTAL <--------------------------- My change do <--------------------------- My change { IFG1 &= ~OFIFG; // Clear OSCFault flag<--------------------------- My change for (i = 0xFF; i > 0; i--); // Time for flag to set<--------------------------- My change } while ((IFG1 & OFIFG)); // OSCFault flag still set?<--------------------------- My change BCSCTL2 |= SELM_2; // MCLK= XT2 (safe)<--------------------------- My change ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD UCTL0 |= CHAR; // 8-bit character UTCTL0 |= SSEL0; // UCLK = ACLK UBR00 = 0x71; // 3.58Mhz/9600 - 372<--------------------------- My change UBR10 = 0x02; //<--------------------------- My change UMCTL0 = 0x00; // no modulation UCTL0 &= ~SWRST; // Initialize USART state machine IE1 |= URXIE0; // Enable USART0 RX interrupt __bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt } #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=USART0RX_VECTOR __interrupt void usart0_rx (void) #elif defined(__GNUC__) void __attribute__ ((interrupt(USART0RX_VECTOR))) usart0_rx (void) #else #error Compiler not supported! #endif { while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready? TXBUF0 = RXBUF0; // RXBUF0 to TXBUF0 }
  7. Thanks Fred, looking at changing fet140_uart01_09600.c now. Have to change it to the XT2 6MHz xtal that my system here has. Thanks again. Regards, Kevin
  8. After searching for more than a week I've been unable to find an example of a serial port program for the 'f149 variant that can send and receive. I was able to get Don Binder's send only program to work fine but I had no luck with tx. It's not a matter of something being at the right frequency as there is no signal coming out at all. I'm new to msp430 but have used atmel parts and uC's since the late 1970's... Most examples online use newer chips than the msp430f149 and it doesn't have calibration code so I did this: //BCSCTL1 = CALBC1_1MHZ; //DCOCTL = CALDCO_1MHZ; //BCSCTL2 &= ~(DIVS_3); DCOCTL = 0x70; BCSCTL1 = 0x73; BCSCTL2 = 0x88; To get Don's code to work for the transmit only programs but it doesn't work for tx for some reason... So anyone have a simple serial port tx/rx example for the msp430f149? I'm a crap programmer and it's a real struggle... Thanks for any help, Regards, Kevin VA3SU
  9. Thanks again Clavier for pushing me in that direction. I was able to get MCLK out using: P5DIR = BIT4; P5SEL = BIT4; A nice 6MHz. Best regards, Kevin
  10. Clavier! I'm located in Waterloo Ontario next time you are here you get the beer of your choice! It's working lol. Thank you so much. Do you happen to know a way to get the clock out to a pin? Bonus pizza? Regards, Kevin
  11. Hi Fred I've spent a fair bit of time there and only find 32kHz examples but I'll look again. Thanks for the suggestion. Regards, Kevin
  12. I'm looking for help in setting up the clocks on a msp430f149. I can find all kinds of ways online after days of googling on how to setup clocks on most of the other devices (I also have an V1.4 launchpad) but no examples on how to setup up a msp430f149 that has a crystal on XT2. (happens to be 6MHz) I've inherited this project and it is what it is. I can get the chip to do what I need it to do in most ways (set and read ports etc.) but I can not get it to use the external crystal. If someone could give me the code that does just that I will buy you a beer next time we meet. Also I believe there is a way to directly output the clock to an output pin if I could be shown that as a bonus I would very much appreciate it. My end goal is a serial port that does tx and rx. I've seen wonderful examples at http://dbindner.freeshell.org/msp430/ but I can't get any of the send and receive ones to work. I can get tx ones to work by playing with the clock settings but only using the internal RC clock. I am Using CCS and C. Thanks very much for reading this. Regards, Kevin
×
×
  • Create New...