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.

MSP430F5239

Other Parts Discussed in Thread: MSP430F5239

Hi Folk

Ok, I seem to have encountered another glitch:

Processor:  MSP430F5239

Package: RGC

CLK: 20Mhz

IDE: CCS

Programmer: FET430

Issue:

I am trying to initialise PORT 7 as GPIO's, now the problem is that if I start a debug session, and look in the "REGISTERS" I do not see PORT7. I only see Ports 1-6 available.

I looked in the MSP430F5239.h file and there is nothing on PORT7, however in the data sheet on page 86 is shows PORT 7 and a comment below says that it is not available in RGV (48 pin) devices. The PIN OUT for the 5239 device clearly shows that PORT 7 is available.

Have I missed something or is something missing in the .h file

Thanks in advance

  • // in msp430f5239.h add the following after the port
    // 5_6 lines (+- Line 1528)
    /************************************************************
    * DIGITAL I/O Port7 Pull up / Pull down Resistors
    ************************************************************/
    #define __MSP430_HAS_PORT7_R__                /* Definition to show that Module is available */
    #define __MSP430_BASEADDRESS_PORT7_R__ 0x0260
    #define P7_BASE                __MSP430_BASEADDRESS_PORT7_R__
    #define __MSP430_HAS_PORTD_R__                /* Definition to show that Module is available */
    #define __MSP430_BASEADDRESS_PORTD_R__ 0x0260
    #define PD_BASE                __MSP430_BASEADDRESS_PORTD_R__
    
    SFR_16BIT(PDIN);                              /* Port D Input */
    SFR_8BIT(PDIN_L);                             /* Port D Input */
    SFR_8BIT(PDIN_H);                             /* Port D Input */
    SFR_16BIT(PDOUT);                             /* Port D Output */
    SFR_8BIT(PDOUT_L);                            /* Port D Output */
    SFR_8BIT(PDOUT_H);                            /* Port D Output */
    SFR_16BIT(PDDIR);                             /* Port D Direction */
    SFR_8BIT(PDDIR_L);                            /* Port D Direction */
    SFR_8BIT(PDDIR_H);                            /* Port D Direction */
    SFR_16BIT(PDREN);                             /* Port D Resistor Enable */
    SFR_8BIT(PDREN_L);                            /* Port D Resistor Enable */
    SFR_8BIT(PDREN_H);                            /* Port D Resistor Enable */
    SFR_16BIT(PDDS);                              /* Port D Drive Strenght */
    SFR_8BIT(PDDS_L);                             /* Port D Drive Strenght */
    SFR_8BIT(PDDS_H);                             /* Port D Drive Strenght */
    SFR_16BIT(PDSEL);                             /* Port D Selection */
    SFR_8BIT(PDSEL_L);                            /* Port D Selection */
    SFR_8BIT(PDSEL_H);                            /* Port D Selection */
    
    
    #define P7IN                   (PDIN_L)       /* Port 7 Input */
    #define P7OUT                  (PDOUT_L)      /* Port 7 Output */
    #define P7DIR                  (PDDIR_L)      /* Port 7 Direction */
    #define P7REN                  (PDREN_L)      /* Port 7 Resistor Enable */
    #define P7DS                   (PDDS_L)       /* Port 7 Drive Strenght */
    #define P7SEL                  (PDSEL_L)      /* Port 7 Selection */
    
    // add the below lines to the msp430f5239.cmd (line 290)
    
    /************************************************************
    * DIGITAL I/O Port7 Pull up / Pull down Resistors
    ************************************************************/
    PDIN               = 0x0260;
    PDIN_L             = 0x0260;
    PDIN_H             = 0x0261;
    PDOUT              = 0x0262;
    PDOUT_L            = 0x0262;
    PDOUT_H            = 0x0263;
    PDDIR              = 0x0264;
    PDDIR_L            = 0x0264;
    PDDIR_H            = 0x0265;
    PDREN              = 0x0266;
    PDREN_L            = 0x0266;
    PDREN_H            = 0x0267;
    PDDS               = 0x0268;
    PDDS_L             = 0x0268;
    PDDS_H             = 0x0269;
    PDSEL              = 0x026A;
    PDSEL_L            = 0x026A;
    PDSEL_H            = 0x026B; 

    This solves the problem

  • Hello Mark,

    Thanks for bringing this to our attention.  You are correct that PORT 7 register adderss is missing from the MSP430F5239.h header file.  I have filed a bug to have that updated.  In the meanwhile, I believe you should be able to update the header file to include PORT 7 base address. 

    Regards,

    Arthi Bhat

  • Hi Arthi

    Pleasure, glad to assist.

    Regards

    Mark

**Attention** This is a public forum