This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2676: MSP430FR2676

Part Number: MSP430FR2676
Other Parts Discussed in Thread: CCSTUDIO

Tool/software:

Hi Team,

I am quite new to msp430fr2676 microcontroller. I was trying to see the registers of the microcontroller on CC studio and was unable to find CAPTIOxCTL registers (CapTouch Registers) while debugging it. Could you please comment on this I have attached a screenshot of the registers that I could see on debugging.

I look forward to hearing from you.

Many thanks,
Criton

.

  • Hi Criton,

    Unlike all the other MSP430 peripheral registers, the Captivate registers are not exposed to end user.  This was done primarily because of the complexity of the peripheral.  Exposing these would allow manipulation of registers that could cause the peripheral not operate correctly and becomes a support issue for TI.  This is why the Captivate Library with API is available which provides a user the ability to manipulate the functionality of the peripheral without having to know the registers and bits and what they do.

    That said, was there a particular reason you are looking for the registers?

  • Hi Dennis Lehman,

    I was exploring the registers to understand how it works so that I can activate other peripherals with respect to that. For instance I wanted to activate a GPIO when there is a touch detected in the capacitive pin 0 and so forth. I started with the Captivate design centre where it generated the code for the sensor design and then uploaded it using the CC studio. 

    Is the captivate library something that I need to download into CCstudio? 

    Many thanks and Kind regards,
    Criton 

  • Hi Criton,

    If you haven't already discovered the Captivate Technology Guide, I would suggest you start in the Software Chapter for an understanding of how the library API works and the "How To" section in that chapter for simple examples showing how to read the sensors. 

    The Captivate library is provided as part of every Captivate Project you generate from the GUI.  It consists of a Base module, which is essentially the HAL layer (hardware abstraction for manipulating the Captivate registers), and Advanced module, which has sensor specific processing functions.

    The Base and Advanced processing functions are located in your project's "captivate" path under the Base and Advanced folders and are compiled into .lib (for CCS projects) and .r43 (for IAR projects). There is no source code available for these modules.  In addition to the .lib modules, the Base and Advanced functions also exist as pre-programmed functions in the MSP430's ROM section of memory.  Locating the Base and Advanced functions in the device's ROM section frees up about 12Kb of space in program memory (FRAM), which gives your application more space.

    There is also a Communications module, which has the UART and I2C drivers needed to allow the MSP430 to communicate sensor data and control to the GUI.  These leverage the MSP430 driverlib functions, which are also included in every project under the "driverlib" folder.  The driverlib source code is available, but in general you won't need it.  The driverlib function calls used by the Captivate library perform all that is needed to communicate with the GUI, but you can re-purpose them for your application to use once you are done using the GUI.  For example, you can re-use the I2C driver functions to communicate with an I2C device on your PCB or the UART to send data to a PC terminal application when using the CAPT-PGMR.

    Last, there is the application layer, which is where your code will reside. Typically, you want to place all of your sensor handling code in what is referred to as a "callback" function.  The callback function is called automatically after the sensor is measured so you don't have to worry when to run your sensor handling code.  This is where you might want to perform some actions, such as turning on/off an LED when a button is pressed.  You can do this by accessing the Port register directly or use one of the driverlib functions to set/clear a GPIO pin.

    Again, read through the Software chapter and you should most everything you need.

    That's it. 

  • Hi Dennis Lehman,

    Many thanks for your response with detailed information. I will go through and revert if I have any queries.

    Kind regards,
    Criton

  • Sure thing.  I'll go ahead and close this post but can re-open it with additional questions within 30 days.  Past 30 days you will need to create a new one.

  • Hi Dennis,

    I started with the design guide. and it generated a code which I then modified as shown below. While debugging I am not able to get the UART output terminal. I use tera term and the uses the msp programmer to connect it to the terminal. I have the LED working whenever I press the sensor but no the UART. Could you please tell me what would be going wrong. I have attached the code below

    Many thanks and Kind regards,
    Criton


    #include <msp430.h>                      // Generic MSP430 Device Include
    #include "CAPT_CommConfig.h"
    #include "UART.h"
    #include "UART_Definitions.h"
    #include "driverlib.h"                   // MSPWare Driver Library
    #include "captivate.h"                   // CapTIvate Touch Software Library
    #include "CAPT_App.h"                    // CapTIvate Application Code
    #include "CAPT_BSP.h"                    // CapTIvate EVM Board Support Package
    #include "intrinsics.h"
    #include "UART_Definitions.h"
    #include "stddef.h"
    
    // Assumes SMCLK = 2MHZ
    #define BAUD_19200
    
    #ifdef BAUD_9600
    // EUSCI runs @ 9600
    #define UART_SAMPLING_MODE    (EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                              (13)
    #define UART_FIRST_STAGE_MOD                                        (0)
    #define UART_SECOND_STAGE_MOD                                       (69)
    
    #elif defined BAUD_19200
    // EUSCI runs @ 19.2K
    #define UART_SAMPLING_MODE      (EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                                (6)
    #define UART_FIRST_STAGE_MOD                                          (8)
    #define UART_SECOND_STAGE_MOD                                         (17)
    
    #elif defined BAUD_38400
    // EUSCI runs @ 38.4K
    #define UART_SAMPLING_MODE      (EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                                (3)
    #define UART_FIRST_STAGE_MOD                                          (4)
    #define UART_SECOND_STAGE_MOD                                         (4)
    
    #elif defined BAUD_57600
    // EUSCI runs @ 57.6K
    #define UART_SAMPLING_MODE      (EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                                (2)
    #define UART_FIRST_STAGE_MOD                                          (2)
    #define UART_SECOND_STAGE_MOD                                         (187)
    
    #elif defined BAUD_115200
    // EUSCI runs @ 115.2K
    #define UART_SAMPLING_MODE      (EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                                (17)
    #define UART_FIRST_STAGE_MOD                                          (0)
    #define UART_SECOND_STAGE_MOD                                         (74)
    
    #elif defined BAUD_230400
    // EUSCI runs @ 230.4K
    #define UART_SAMPLING_MODE      (EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                                (8)
    #define UART_FIRST_STAGE_MOD                                          (0)
    #define UART_SECOND_STAGE_MOD                                         (214)
    
    #elif defined BAUD_250000
    // EUSCI runs @ 250K
    #define UART_SAMPLING_MODE      (EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION)
    #define UART_PRESCALER                                                (8)
    #define UART_FIRST_STAGE_MOD                                          (0)
    #define UART_SECOND_STAGE_MOD                                         (0)
    
    #else
    #warning "NO BAUD RATE SELECTED"
    #endif
    
    
      const tUARTPort g_myUartPort =
    {
        .pbReceiveCallback = NULL,
        .pbErrorCallback = 0,
        .peripheralParameters.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
        .peripheralParameters.clockPrescalar = UART_PRESCALER,
        .peripheralParameters.firstModReg = UART_FIRST_STAGE_MOD,
        .peripheralParameters.secondModReg = UART_SECOND_STAGE_MOD,
        .peripheralParameters.parity = EUSCI_A_UART_NO_PARITY,
        .peripheralParameters.msborLsbFirst = EUSCI_A_UART_LSB_FIRST,
        .peripheralParameters.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT,
        .peripheralParameters.uartMode = EUSCI_A_UART_MODE,
        .peripheralParameters.overSampling = UART_SAMPLING_MODE
    };
    
    
    void main(void)
    {
    	//
    	// Initialize the MCU
    	// BSP_configureMCU() sets up the device IO and clocking
    	// The global interrupt enable is set to allow peripherals
    	// to wake the MCU.
    	//
       
    	WDTCTL = WDTPW | WDTHOLD;
        P6OUT &= ~BIT0;                         // Clear P1.0 output latch for a defined power-on state
        P6DIR |= BIT0;                        // Set P1.0 to output direction
    	BSP_configureMCU();
    	//__bis_SR_register(GIE);
        UART_openPort(&g_myUartPort);        // Open Uart for communication
        UART_transmitBuffer("\n\rHello World!\n\r", sizeof("\n\rHello World!\n\r")); // welcome message
    
    	//
    	// Start the CapTIvate application
    	//
    	CAPT_appStart();
    
    	//
    	// Background Loop
    	//
    	while(1)
    	{
    		//
    		// Run the captivate application handler.
    		//
    	    LED1_ON;
            if(CAPT_appHandler()==true)
             {
                P6OUT = BIT0;   // led on port 6 turns on
                UART_transmitBuffer("\n\rHello World!\n\r", sizeof("\n\rHello World!\n\r")); // interuupt message
             }
            else 
                {
                    P6OUT = ~BIT0; // led on port six turns off
                }
    		//
    		// This is a great place to add in any 
    		// background application code.
    		//
    		__no_operation();
    
    		//
    		// End of background loop iteration
    		// Go to sleep if there is nothing left to do
    		//
    		CAPT_appSleep();
    		
    	} // End background loop
    } // End main()
    

  • This issue is solved i saw the forum post regarding the R24/R25. I connected ftdi to the rx and tx pins on the mcu to the PC. 

**Attention** This is a public forum