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.

CCS/MSP430FR2633: Where port A and it's register in MSP430FR2633 MCU

Part Number: MSP430FR2633

Tool/software: Code Composer Studio

I'm reading "CodeSizeOptimized_OneButton-Demo" project but I cant understand what port A and it's register. I'm searching some information about Port A in User manual and MSP430FR2633 datasheet but I dont get anything. In CCS, it can find in msp430fr2633.h. So I don't know what it is and how to use it.

And what code use for

PAOUT = 0x0000;
PADIR = 0xFCC1;
PASEL0 = 0x033C;
P3OUT = 0x00;
P3DIR = 0x07;
P3SEL0 = 0x00;

 Thank you so much

Best regard

Dat

  • PA is simply the P1 and P2 word registers combined into a single long register. For example, the above configuration sets P1DIR to 0xC1 and P2DIR to 0xFC, as well as P1SEL0 to 0x3C and P2SEL0 to 0x03.

    Regards,
    Ryan
  • Thank you, and i have another question. I try LAB 3 - Exploring the CapTIvate™ Touch Library in Workshop (Getting Started) to turn on LED when any button is pressed. But it's not working, this my code I add from example code in LAB 1.


    In CAPT_UserConfig.h:

    "extern tSensor button;
    extern tSensor prox;
    extern tSensor slider;
    extern tSensor wheel;

    And in file main.c:

    #include <msp430.h> // Generic MSP430 Device Include
    #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

    void button_callback(tSensor* pSensor)
    {
    if((pSensor->bSensorTouch == true) && (pSensor->bSensorPrevTouch == false))
    {
    LED2_ON;
    }
    else if ((pSensor->bSensorTouch == false) && (pSensor->bSensorPrevTouch == true))
    {
    LED2_OFF;
    }
    }

    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;
    BSP_configureMCU();
    __bis_SR_register(GIE);

    //
    // Start the CapTIvate application
    //
    MAP_CAPT_registerCallback(&button, &button_callback);
    CAPT_appStart();

    //
    // Background Loop
    //
    while(1)
    {
    //
    // Run the captivate application handler.
    // Set LED1 while the app handler is running,
    // and set LED2 if proximity is detected
    // on any sensor.
    //
    /*
    LED1_ON;
    if(CAPT_appHandler()==true)
    LED2_ON;
    else
    LED2_OFF;
    LED1_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()

  • Please follow all lab instructions properly and debug your program if necessary, it appears that there is other functionality inside of the main while loop which is controlling the status of the LEDs.

    Regards,
    Ryan

**Attention** This is a public forum