Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22190

CCS/MSP430FR6047: Getting simple UART to work

$
0
0

Part Number:MSP430FR6047

Tool/software: Code Composer Studio

I am attempting to get a simple serial out from my EVM430-FR6047 board. The long term goal is to use this code in conjunction with the ultrasonic measuring example code to transmit flow readings to another microcontroller for IoT transmission. Here is the code:

#include <msp430.h>


void main(void) {
    //Stuff for UART
    char wel[] ="HelloWord!!";
    volatile char i=0;

    //USCI setup code
      P4SEL1 |= 0x30;                       //P4.4,5 = USC_A1 TXD/RXD 0011 0000 
      UCA1CTL1 |= UCSWRST;                 //**Put state machine in reset**
      UCA1CTL1 |= UCSSEL_1;                 //Choose 32668Hz
      UCA1BR0 = 3;                          //Baud rate 9600 (refer users guide)
      UCA1BR1 = 0x00;                       //cHOOSE 32768hz
      UCA1MCTLW = 0x06;                      //Modulation UCBRSx=3, UCBRFx=0
      UCA1CTL0 = 0x00;                      //Not used
      UCA1CTL1 &= ~UCSWRST;                 // **Put USCI in operation mode**


      while(1)
      {i=0;
          while (wel[i] !='\0'){
              UCA1TXBUF = wel[i];
            while (UCA1STATW&UCBUSY);
            i++;
          }
          UCA1TXBUF = 0x0a;
        while(UCA1STATW&UCBUSY);
            UCA1TXBUF = 0x0d;
        while(UCA1STATW&UCBUSY);
      }

This code is inspired by a 2015 youtube video and modified it using the MSP430FR6xx User Guide. I feel like the answer is probably on page 767 where it talks about initializing and re-configuring the eUSCI_A module, but I am having trouble following it. I think the problem is in my configuration of the registers, but don't really know what to do next. Do the physical board jumpers need to be adjusted in any way? Everything compiles fine in Code Composer Studio onto by evaluation board, I just don't get any feedback into my serial connected terminal.

I feel like chip to chip communication should be easy and I am just doing something simple wrong. Any direction or help would be much appreciated


Viewing all articles
Browse latest Browse all 22190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>