Jump to content
MMKC

Pin map MSP430G2553 28pin

Recommended Posts

There is not pin mapping at the moment for the 28 pin TSOP and 32 pin QFN packages. It is fairly easy to make this work with the 28 pin TSOP by creating another variant with a modified pins_energia.h.

Out of curiosity, what board are you using that has the 28 pin device on it?

 

Just in case you didn't find it yet, here is the pin map for the 20 PDIP package that is on the Launchpad.

https://github.com/energia/Energia/wiki/Hardware#wiki-LaunchPad_MSP430G2553

Share this post


Link to post
Share on other sites

First, thanks for your reply
This is pin map for msp430g553 28 pin

/*
  ************************************************************************
  * pins_energia.h
  *
  * Energia core files for MSP430
  * Copyright (c) 2012 Robert Wessels. All right reserved.
  *
  *     Contribution: Rei VILO
  *
  ***********************************************************************
  Derived from:
  pins_arduino.h - Pin definition functions for Arduino
  Part of Arduino - http://www.arduino.cc/
 
  Copyright (c) 2007 David A. Mellis
 
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
 
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
 
  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
*/
 
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#ifndef BV
#define BV(x) (1 << (x))
#endif
 
#if defined(__MSP430_HAS_USCI__)
static const uint8_t SS      = 8;  /* P2.0 */
static const uint8_t SCK     = 7;  /* P1.5 */
static const uint8_t MOSI    = 15; /* P1.7 */
static const uint8_t MISO    = 14; /* P1.6 */
static const uint8_t TWISDA  = 14;  /* P1.6 */
static const uint8_t TWISCL  = 15;  /* P1.7 */
static const uint8_t UARTRXD = 3;  /* Receive  Data (RXD) at P1.1 */
static const uint8_t UARTTXD = 4;  /* Transmit Data (TXD) at P1.2 */
#define TWISDA_SET_MODE  (PORT_SELECTION0 | PORT_SELECTION1 /* | INPUT_PULLUP*/) /* do not enable the pull ups for this device */
#define TWISCL_SET_MODE  (PORT_SELECTION0 | PORT_SELECTION1 /* | INPUT_PULLUP*/)
#define UARTRXD_SET_MODE (PORT_SELECTION0 | PORT_SELECTION1 | INPUT)
#define UARTTXD_SET_MODE (PORT_SELECTION0 | PORT_SELECTION1 | OUTPUT)
#endif
 
#if defined(__MSP430_HAS_USI__)
static const uint8_t SS   = 8;  /* P2.0 */
static const uint8_t SCK  = 7;  /* P1.5 */
static const uint8_t MOSI = 14; /* P1.6 */
static const uint8_t MISO = 15; /* P1.7 */
static const uint8_t TWISDA  = 14;  /* P1.7 */
static const uint8_t TWISCL  = 15;  /* P1.6 */
static const uint8_t UARTRXD = 4;  /* Receive  Data (RXD) at P1.2 */
static const uint8_t UARTTXD = 3;  /* Transmit Data (TXD) at P1.1 */
#define TWISDA_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
#define TWISCL_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
#define UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
#define UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
#endif
 
static const uint8_t A0  = 0;
static const uint8_t A1  = 1;
static const uint8_t A2  = 2;
static const uint8_t A3  = 3;
static const uint8_t A4  = 4;
static const uint8_t A5  = 5;
static const uint8_t A6  = 6;
static const uint8_t A7  = 7;
static const uint8_t A10 = 10; // special. This is the internal temp sensor
 
//                      +-\/-+
//               VCC   1|    |20  GND
//         (A0)  P1.0  2|    |19  XIN
//         (A1)  P1.1  3|    |18  XOUT
//         (A2)  P1.2  4|    |17  TEST
//         (A3)  P1.3  5|    |16  RST#
//         (A4)  P1.4  6|    |15  P1.7  (A7) (SCL) (MISO) depends on chip
//         (A5)  P1.5  7|    |14  P1.6  (A6) (SDA) (MOSI)
//  P3.1 22|    |27  P3.7 
//  P3.0 21|    |26  P3.6
//               P2.0  8|    |25  P3.5
//               P2.1  9|    |13  P2.5
//               P2.2 10|    |12  P2.4
//               P3.2 23|    |11  P2.3
//               P3.3 24|    |28  P3.4
//                      +----+
//
 
// Pin names based on the silkscreen
//
static const uint8_t P1_0 = 2;
static const uint8_t P1_1 = 3;
static const uint8_t P1_2 = 4;
static const uint8_t P1_3 = 5;
static const uint8_t P1_4 = 6;
static const uint8_t P1_5 = 7;
static const uint8_t P2_0 = 8;
static const uint8_t P2_1 = 9;
static const uint8_t P2_2 = 10;
static const uint8_t P2_3 = 11;
static const uint8_t P2_4 = 12;
static const uint8_t P2_5 = 13;
static const uint8_t P1_6 = 14;
static const uint8_t P1_7 = 15;
static const uint8_t P2_7 = 18;
static const uint8_t P2_6 = 19;
static const uint8_t P3_0 = 21;
static const uint8_t P3_1 = 22;
static const uint8_t P3_2 = 23;
static const uint8_t P3_3 = 24;
static const uint8_t P3_4 = 25;
static const uint8_t P3_5 = 26;
static const uint8_t P3_6 = 27;
static const uint8_t P3_7 = 28;
 
static const uint8_t RED_LED = 2;
static const uint8_t GREEN_LED = 14;
static const uint8_t PUSH2 = 5;
static const uint8_t TEMPSENSOR = 10; // depends on chip
 
 
#ifdef ARDUINO_MAIN
 
const uint16_t port_to_input[] = {
NOT_A_PORT,
(uint16_t) &P1IN,
(uint16_t) &P2IN,
#ifdef __MSP430_HAS_PORT3_R__
(uint16_t) &P3IN,
#endif
};
 
const uint16_t port_to_output[] = {
NOT_A_PORT,
(uint16_t) &P1OUT,
(uint16_t) &P2OUT,
(uint16_t) &P3OUT,
 
};
 
const uint16_t port_to_dir[] = {
NOT_A_PORT,
(uint16_t) &P1DIR,
(uint16_t) &P2DIR,
(uint16_t) &P3DIR,
};
 
const uint16_t port_to_ren[] = {
NOT_A_PORT,
(uint16_t) &P1REN,
(uint16_t) &P2REN,
(uint16_t) &P3REN,
 
};
 
const uint16_t port_to_sel0[] = {  /* put this PxSEL register under the group of PxSEL0 */
NOT_A_PORT,
(uint16_t) &P1SEL,
(uint16_t) &P2SEL,
(uint16_t) &P3SEL,
};
 
const uint16_t port_to_sel2[] = {
NOT_A_PORT,
#ifdef P1SEL2_
(uint16_t) &P1SEL2,
#else
        NOT_A_PORT,
#endif
#ifdef P2SEL2_
(uint16_t) &P2SEL2,
#else 
        NOT_A_PORT,
#endif
#ifdef P3SEL2_
(uint16_t) &P3SEL2,
#else
        NOT_A_PORT,
#endif
};
 
 
/* 
 * Defines for devices with 2x TA3 timers (e.g. MSP430g2553). On the 20pin devices, upto 3 analog outputs are available
 * T0A1, T1A1 and T1A2 
 */
const uint8_t digital_pin_to_timer[] = {
NOT_ON_TIMER, /*  dummy */
NOT_ON_TIMER, /*  1 - VCC */
NOT_ON_TIMER, /*  2 - P1.0 */
T0A0,         /*  3 - P1.1, note: A0 output cannot be used with analogWrite */
T0A1,         /*  4 - P1.2 */
NOT_ON_TIMER, /*  5 - P1.3 */
NOT_ON_TIMER, /*  6 - P1.4 note: special case. Leaving as no timer due to difficulty determining if available */
T0A0,         /*  7 - P1.5 note: A0 output cannot be used with analogWrite  */
#if defined(__MSP430_HAS_T1A3__) 
T1A0,         /*  8 - P2.0 note: A0 output cannot be used with analogWrite */
T1A1,         /*  9 - P2.1 */
T1A1,         /* 10 - P2.2 */
T1A0,         /* 11 - P2.3 note: A0 output cannot be used with analogWrite  */
T1A2,         /* 12 - P2.4 */
T1A2,         /* 13 - P2.5 */
#else
NOT_ON_TIMER, /*  8 - P2.0 */
NOT_ON_TIMER, /*  9 - P2.1 */
NOT_ON_TIMER, /* 10 - P2.3 */
NOT_ON_TIMER, /* 11 - P2.4 */
NOT_ON_TIMER, /* 12 - P2.5 */
NOT_ON_TIMER, /* 13 - P2.6 */
#endif
T0A1,         /* 14 - P1.6 */
NOT_ON_TIMER, /* 15 - P1.7 */
NOT_ON_TIMER, /* 16 - /RESET */  
NOT_ON_TIMER, /* 17 - TEST */  
NOT_ON_TIMER, /* 18 - XOUT - P2.7 */
T0A1,         /* 19 - XIN - P2.6: */
NOT_ON_TIMER, /* 20 - GND */
};
 
const uint8_t digital_pin_to_port[] = {
NOT_A_PIN, /* dummy */
NOT_A_PIN, /* 1 */
P1, /* 2 */
P1, /* 3 */
P1, /* 4 */
P1, /* 5 */
P1, /* 6 */
P1, /* 7 */
P2, /* 8 */
P2, /* 9 */
P2, /* 10 */
P2, /* 11 */
P2, /* 12 */
P2, /* 13 */
P1, /* 14 */
P1, /* 15 */
NOT_A_PIN, /* 16 */
NOT_A_PIN, /* 17 */
P2, /* 18 */
P2, /* 19 */
NOT_A_PIN, /* 20 */
P3, /* 21 */
P3, /* 22 */
P3, /* 23 */
P3, /* 24 */
P3, /* 25 */
P3, /* 26 */
P3, /* 27 */
P3, /* 28 */ 
};
 
const uint8_t digital_pin_to_bit_mask[] = {
NOT_A_PIN, /* 0,  pin count starts at 1 */
NOT_A_PIN, /* 1,  VCC */
BV(0),     /* 2,  port P1.0 */
BV(1),     /* 3,  port P1.1 */
BV(2),     /* 4,  port P1.2 */
BV(3),     /* 5,  port P1.3*/
BV(4),     /* 6,  port P1.4 */
BV(5),     /* 7,  port P1.5 */
BV(0),     /* 8,  port P2.0 */
BV(1),     /* 9,  port P2.1 */
BV(2),     /* 10, port P2.2 */
BV(3),     /* 11, port P2.3 */
BV(4),     /* 12, port P2.4 */
BV(5),     /* 13, port P2.5 */
BV(6),     /* 14, port P1.6 */
BV(7),     /* 15, port P1.7 */
NOT_A_PIN, /* 16, RST */
NOT_A_PIN, /* 17, TEST */
BV(7),     /* 18, XOUT */
BV(6),     /* 19, XIN */
NOT_A_PIN, /* 20, GND */
BV(0),     /* 21, port P3.0 */
BV(1),     /* 22, port P3.1 */
BV(2),     /* 23, port P3.2 */
BV(3),     /* 24, port P3.3 */
BV(4),     /* 25, port P3.4 */
BV(5),     /* 26, port P3.5 */
BV(6),     /* 27, port P3.6 */
BV(7),     /* 28, port P3.7 */
};
#endif
#endif


I tested with port 3, it worked
But I have a problem that I can interface with "SPI + RF 24L01". And I test with g2553 20 pin, it worked :)
I download code  from this page: http://www.elecfreaks.com/480.html andchage the pin
**   SPI-compatible                                                 **
**   CS - to digital pin 8                                          **
**   CSN - to digital pin 9  (SS pin)                               **
**   MOSI - to digital pin 15 (MOSI pin)                            **
**   MISO - to digital pin 14 (MISO pin)                            **
**   CLK - to digital pin 7 (SCK pin)   
**   IRQ - to digital pin 10

Share this post


Link to post
Share on other sites

 

/*
  ************************************************************************
  * pins_energia.h
  *
  * Energia core files for MSP430
  * Copyright © 2012 Robert Wessels. All right reserved.
  *
  *     Contribution: Rei VILO
  *
  ***********************************************************************
  Derived from:
  pins_arduino.h - Pin definition functions for Arduino
  Part of Arduino - http://www.arduino.cc/
 
  Copyright © 2007 David A. Mellis
 
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
 
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
 
  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
*/
 
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#ifndef BV
#define BV(x) (1 << (x))
#endif
 
#if defined(__MSP430_HAS_USCI__)
static const uint8_t SS      = 10;  /* P2.0 */
static const uint8_t SCK     = 7;  /* P1.5 */
static const uint8_t MOSI    = 23; /* P1.7 */
static const uint8_t MISO    = 22; /* P1.6 */
static const uint8_t TWISDA  = 22;  /* P1.6 */
static const uint8_t TWISCL  = 23;  /* P1.7 */
static const uint8_t UARTRXD = 3;  /* Receive  Data (RXD) at P1.1 */
static const uint8_t UARTTXD = 4;  /* Transmit Data (TXD) at P1.2 */
#define TWISDA_SET_MODE  (PORT_SELECTION0 | PORT_SELECTION1 /* | INPUT_PULLUP*/) /* do not enable the pull ups for this device */
#define TWISCL_SET_MODE  (PORT_SELECTION0 | PORT_SELECTION1 /* | INPUT_PULLUP*/)
#define UARTRXD_SET_MODE (PORT_SELECTION0 | PORT_SELECTION1 | INPUT)
#define UARTTXD_SET_MODE (PORT_SELECTION0 | PORT_SELECTION1 | OUTPUT)
#endif
 
#if defined(__MSP430_HAS_USI__)
static const uint8_t SS   = 10;  /* P2.0 */
static const uint8_t SCK  = 7;  /* P1.5 */
static const uint8_t MOSI = 22; /* P1.6 */
static const uint8_t MISO = 23; /* P1.7 */
static const uint8_t TWISDA  = 23;  /* P1.7 */
static const uint8_t TWISCL  = 22;  /* P1.6 */
static const uint8_t UARTRXD = 4;  /* Receive  Data (RXD) at P1.2 */
static const uint8_t UARTTXD = 3;  /* Transmit Data (TXD) at P1.1 */
#define TWISDA_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
#define TWISCL_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
#define UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
#define UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
#endif
 
static const uint8_t A0  = 0;
static const uint8_t A1  = 1;
static const uint8_t A2  = 2;
static const uint8_t A3  = 3;
static const uint8_t A4  = 4;
static const uint8_t A5  = 5;
static const uint8_t A6  = 22;
static const uint8_t A7  = 23;
static const uint8_t A10 = 12; // special. This is the internal temp sensor
 
//                      +-\/-+
//               VCC   1|    |28  GND
//         (A0)  P1.0  2|    |27  XIN
//         (A1)  P1.1  3|    |26  XOUT
//         (A2)  P1.2  4|    |25  TEST
//         (A3)  P1.3  5|    |24  RST#
//         (A4)  P1.4  6|    |23  P1.7  (A7) (SCL) (MISO) depends on chip
//         (A5)  P1.5  7|    |22  P1.6  (A6) (SDA) (MOSI)
//               P3.1  8|    |21  P3.7 
//               P3.0  9|    |20  P3.6
//               P2.0 10|    |19  P3.5
//               P2.1 11|    |18  P2.5
//               P2.2 12|    |17  P2.4
//               P3.2 13|    |16  P2.3
//               P3.3 14|    |15  P3.4
//                      +----+
//
 
// Pin names based on the silkscreen
//
static const uint8_t P1_0 = 2;
static const uint8_t P1_1 = 3;
static const uint8_t P1_2 = 4;
static const uint8_t P1_3 = 5;
static const uint8_t P1_4 = 6;
static const uint8_t P1_5 = 7;
static const uint8_t P3_1 = 8;
static const uint8_t P3_0 = 9;
static const uint8_t P2_0 = 10;
static const uint8_t P2_1 = 11;
static const uint8_t P2_2 = 12;
static const uint8_t P3_2 = 13;
static const uint8_t P3_3 = 14;
static const uint8_t P3_4 = 15;
static const uint8_t P2_3 = 16;
static const uint8_t P2_4 = 17;
static const uint8_t P2_5 = 18;
static const uint8_t P3_5 = 19;
static const uint8_t P3_6 = 20;
static const uint8_t P3_7 = 21;
static const uint8_t P1_6 = 22;
static const uint8_t P1_7 = 23;
static const uint8_t P2_7 = 26;
static const uint8_t P2_6 = 27;
 
static const uint8_t RED_LED = 2;
static const uint8_t GREEN_LED = 14;
static const uint8_t PUSH2 = 5;
static const uint8_t TEMPSENSOR = 10; // depends on chip
 
 
#ifdef ARDUINO_MAIN
 
const uint16_t port_to_input[] = {
NOT_A_PORT,
(uint16_t) &P1IN,
(uint16_t) &P2IN,
#ifdef __MSP430_HAS_PORT3_R__
(uint16_t) &P3IN,
#endif
};
 
const uint16_t port_to_output[] = {
NOT_A_PORT,
(uint16_t) &P1OUT,
(uint16_t) &P2OUT,
(uint16_t) &P3OUT,
 
};
 
const uint16_t port_to_dir[] = {
NOT_A_PORT,
(uint16_t) &P1DIR,
(uint16_t) &P2DIR,
(uint16_t) &P3DIR,
};
 
const uint16_t port_to_ren[] = {
NOT_A_PORT,
(uint16_t) &P1REN,
(uint16_t) &P2REN,
(uint16_t) &P3REN,
 
};
 
const uint16_t port_to_sel0[] = {  /* put this PxSEL register under the group of PxSEL0 */
NOT_A_PORT,
(uint16_t) &P1SEL,
(uint16_t) &P2SEL,
(uint16_t) &P3SEL,
};
 
const uint16_t port_to_sel2[] = {
NOT_A_PORT,
#ifdef P1SEL2_
(uint16_t) &P1SEL2,
#else
        NOT_A_PORT,
#endif
#ifdef P2SEL2_
(uint16_t) &P2SEL2,
#else 
        NOT_A_PORT,
#endif
#ifdef P3SEL2_
(uint16_t) &P3SEL2,
#else
        NOT_A_PORT,
#endif
};
 
 
/* 
 * Defines for devices with 2x TA3 timers (e.g. MSP430g2553). On the 20pin devices, upto 3 analog outputs are available
 * T0A1, T1A1 and T1A2 
 */
const uint8_t digital_pin_to_timer[] = {
NOT_ON_TIMER, /*  dummy */
NOT_ON_TIMER, /*  1 - VCC */
NOT_ON_TIMER, /*  2 - P1.0 */
T0A0,         /*  3 - P1.1, note: A0 output cannot be used with analogWrite */
T0A1,         /*  4 - P1.2 */
NOT_ON_TIMER, /*  5 - P1.3 */
NOT_ON_TIMER, /*  6 - P1.4 note: special case. Leaving as no timer due to difficulty determining if available */
T0A0,         /*  7 - P1.5 note: A0 output cannot be used with analogWrite  */
#if defined(__MSP430_HAS_T1A3__) 
T1A0,         /*  8 - P3.1 note: A0 output cannot be used with analogWrite */
T1A1,         /*  9 - P3.0 */
T1A1,         /* 10 - P2.0 */
T1A0,         /* 11 - P2.1 note: A0 output cannot be used with analogWrite  */
T1A2,         /* 12 - P2.2 */
T1A2,         /* 13 - P3.2 */
T1A2,         /* 14 - P3.3 */
T0A0,         /* 15 - P3.4 note: A0 output cannot be used with analogWrite  */
T1A0,         /* 16 - P2.3 note: A0 output cannot be used with analogWrite  */
T1A2,         /* 17 - P2.4 */
T1A2,         /* 18 - P2.5 */
T0A1,         /* 19 - P3.5 */
T0A2,         /* 20 - P3.6 */
#else
NOT_ON_TIMER, /*  8 - P3.1 */
NOT_ON_TIMER, /*  9 - P3.0 */
NOT_ON_TIMER, /* 10 - P2.0 */
NOT_ON_TIMER, /* 11 - P2.1 */
NOT_ON_TIMER, /* 12 - P2.2 */
NOT_ON_TIMER, /* 13 - P3.2 */
NOT_ON_TIMER, /* 14 - P3.3 */
NOT_ON_TIMER, /* 15 - P3.4 */
NOT_ON_TIMER, /* 16 - P2.3 */
NOT_ON_TIMER, /* 17 - P2.4 */
NOT_ON_TIMER, /* 18 - P2.5 */
NOT_ON_TIMER, /* 19 - P3.5 */
NOT_ON_TIMER, /* 20 - P3.6 */
#endif
T0A1,         /* 22 - P1.6 */
NOT_ON_TIMER, /* 23 - P1.7 */
NOT_ON_TIMER, /* 24 - /RESET */  
NOT_ON_TIMER, /* 25 - TEST */  
NOT_ON_TIMER, /* 26 - XOUT - P2.7 */
T0A1,         /* 27 - XIN - P2.6: */
NOT_ON_TIMER, /* 28 - GND */
};
 
const uint8_t digital_pin_to_port[] = {
NOT_A_PIN, /* dummy */
NOT_A_PIN, /* 1 */
P1, /* 2 */
P1, /* 3 */
P1, /* 4 */
P1, /* 5 */
P1, /* 6 */
P1, /* 7 */
P3, /* 8 */
P3, /* 9 */
P2, /* 10 */
P2, /* 11 */
P2, /* 12 */
P3, /* 13 */
P3, /* 14 */
P3, /* 15 */
P3, /* 16 */
P2, /* 17 */
P2, /* 18 */
P3, /* 19 */
P3, /* 20 */
P3, /* 21 */
P1, /* 22 */
P1, /* 23 */
NOT_A_PIN, /* 24 */
NOT_A_PIN, /* 25 */
P2, /* 26 */
P2, /* 27 */
NOT_A_PIN, /* 28 */ 
};
 
const uint8_t digital_pin_to_bit_mask[] = {
NOT_A_PIN, /* 0,  pin count starts at 1 */
NOT_A_PIN, /* 1,  VCC */
BV(0),     /* 2,  port P1.0 */
BV(1),     /* 3,  port P1.1 */
BV(2),     /* 4,  port P1.2 */
BV(3),     /* 5,  port P1.3*/
BV(4),     /* 6,  port P1.4 */
BV(5),     /* 7,  port P1.5 */
BV(1),     /* 8,  port P3.1 */
BV(0),     /* 9,  port P3.0 */
BV(0),     /* 10, port P2.0 */
BV(1),     /* 11, port P2.1 */
BV(2),     /* 12, port P2.2 */
BV(2),     /* 13, port P3.2 */
BV(3),     /* 14, port P3.3 */
BV(4),     /* 15, port P3.4 */
BV(3),     /* 16, port P2.3 */
BV(4),     /* 17, port P2.4 */
BV(5),     /* 18, port P2.5 */
BV(5),     /* 19, port P3.5 */
BV(6),     /* 20, port P3.6 */
BV(7),     /* 21, port P3.7 */
BV(6),     /* 22, port P1.6 */
BV(7),     /* 23, port P1.7 */
NOT_A_PIN, /* 24, RST */
NOT_A_PIN, /* 25, TEST */
BV(7),     /* 26, XOUT */
BV(6),     /* 27, XIN */
NOT_A_PIN, /* 28, GND */
};
#endif
#endif

I made this to use msp430g2553 with the tssop28 package. is this correct?

do i have to change any other file for the Ports 3.x?

 

i don't realy know the files of energia. For the new msp430g2955 that is coming out do i just need to change this file? even for the new timers and analog pins?

Share this post


Link to post
Share on other sites

i realy could use a developer help becouse i don't exacly know how the files are organized. Do i need to add register for T0Bx? and for the new ADC?

 

 

i made this in pin mapping:

 

 

/*

  ************************************************************************
  * pins_energia.h
  *
  * Energia core files for MSP430
  * Copyright © 2012 Robert Wessels. All right reserved.
  *
  *     Contribution: Rei VILO
  *
  ***********************************************************************
  Derived from:
  pins_arduino.h - Pin definition functions for Arduino
  Part of Arduino - http://www.arduino.cc/
 
  Copyright © 2007 David A. Mellis
 
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
 
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
 
  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
*/
 
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#ifndef BV
#define BV(x) (1 << (x))
#endif
 
#if defined(__MSP430_HAS_USCI__)
static const uint8_t SS      = 10;  /* P2.0 */
static const uint8_t SCK     = 7;  /* P1.5 */
static const uint8_t MOSI    = 12; /* P1.7 */
static const uint8_t MISO    = 13; /* P1.6 */
static const uint8_t TWISDA  = 22;  /* P1.6 */
static const uint8_t TWISCL  = 23;  /* P1.7 */
static const uint8_t UARTRXD = 3;  /* Receive  Data (RXD) at P1.1 */
static const uint8_t UARTTXD = 4;  /* Transmit Data (TXD) at P1.2 */
#define TWISDA_SET_MODE  (PORT_SELECTION0 | PORT_SELECTION1 /* | INPUT_PULLUP*/) /* do not enable the pull ups for this device */
#define TWISCL_SET_MODE  (PORT_SELECTION0 | PORT_SELECTION1 /* | INPUT_PULLUP*/)
#define UARTRXD_SET_MODE (PORT_SELECTION0 | PORT_SELECTION1 | INPUT)
#define UARTTXD_SET_MODE (PORT_SELECTION0 | PORT_SELECTION1 | OUTPUT)
#endif
 
#if defined(__MSP430_HAS_USI__)
static const uint8_t SS   = 10;  /* P2.0 */
static const uint8_t SCK  = 7;  /* P1.5 */
static const uint8_t MOSI = 12; /* P3.1 */
static const uint8_t MISO = 13; /* P3.2 */
static const uint8_t TWISDA  = 23;  /* P1.7 */
static const uint8_t TWISCL  = 22;  /* P1.6 */
static const uint8_t UARTRXD = 4;  /* Receive  Data (RXD) at P1.2 */
static const uint8_t UARTTXD = 3;  /* Transmit Data (TXD) at P1.1 */
#define TWISDA_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
#define TWISCL_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
#define UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
#define UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
#endif
 
static const uint8_t A0  = 0;
static const uint8_t A1  = 1;
static const uint8_t A2  = 2;
static const uint8_t A3  = 3;
static const uint8_t A4  = 4;
static const uint8_t A5  = 5;
static const uint8_t A6  = 22;
static const uint8_t A7  = 23;
static const uint8_t A10 = 12; // special. This is the internal temp sensor
 
//                      +-\/-+
//               TEST  1|    |38  P1.7
//               VCC   2|    |37  P1.6
//         ROSC  P2.5  3|    |36  P1.5
//               GND   4|    |35  P1.4
//         XOUT  P2.7  5|    |34  P1.3
//         XIN   P2.6  6|    |33  P1.2  
//               RST   7|    |32  P1.1  
//       (A0)    P2.0  8|    |31  P1.0 
//       (A1)    P2.1  9|    |30  P2.4 (A4)
//       (A2)    P2.2 10|    |29  P2.3 (A3)
//       (A5)    P3.0 11|    |28  P3.7 (A7)
// (SDA) (MOSI)  P3.1 12|    |27  P3.6 (A6)
// (SCL) (MISO)  P3.2 13|    |26  P3.5 RXD
//               P3.3 14|    |25  P3.4 TX
//               AGND 15|    |24  P4.7
//               AVCC 16|    |23  P4.6 (A15)
//               P4.0 17|    |22  P4.5 (A14)
//               P4.1 18|    |21  P4.4 (A13)
//               P4.2 19|    |20  P4.3 (A12)
//                      +----+
//
 
// Pin names based on the silkscreen
//
static const uint8_t P2_5 = 3;
static const uint8_t P2_7 = 5;
static const uint8_t P2_6 = 6;
static const uint8_t P2_0 = 8;
static const uint8_t P2_1 = 9;
static const uint8_t P2_2 = 10;
static const uint8_t P3_0 = 11;
static const uint8_t P3_1 = 12;
static const uint8_t P3_2 = 13;
static const uint8_t P3_3 = 14;
static const uint8_t P4_0 = 17;
static const uint8_t P4_1 = 18;
static const uint8_t P4_2 = 19;
static const uint8_t P4_3 = 20;
static const uint8_t P4_4 = 21;
static const uint8_t P4_5 = 22;
static const uint8_t P4_6 = 23;
static const uint8_t P4_7 = 24;
static const uint8_t P3_4 = 25;
static const uint8_t P3_5 = 26;
static const uint8_t P3_6 = 27;
static const uint8_t P3_7 = 28;
static const uint8_t P2_3 = 29;
static const uint8_t P2_4 = 30;
static const uint8_t P1_0 = 31;
static const uint8_t P1_1 = 32;
static const uint8_t P1_2 = 33;
static const uint8_t P1_3 = 34;
static const uint8_t P1_4 = 35;
static const uint8_t P1_5 = 36;
static const uint8_t P1_6 = 37;
static const uint8_t P1_7 = 38;
 
//static const uint8_t RED_LED = 2;
//static const uint8_t GREEN_LED = 14;
//static const uint8_t PUSH2 = 5;
//static const uint8_t TEMPSENSOR = 10; // depends on chip
 
 
#ifdef ARDUINO_MAIN
 
const uint16_t port_to_input[] = {
NOT_A_PORT,
(uint16_t) &P1IN,
(uint16_t) &P2IN,
#ifdef __MSP430_HAS_PORT3_R__
(uint16_t) &P3IN,
(uint16_t) &P4IN,
#endif
};
 
const uint16_t port_to_output[] = {
NOT_A_PORT,
(uint16_t) &P1OUT,
(uint16_t) &P2OUT,
(uint16_t) &P3OUT,
(uint16_t) &P4OUT,
 
};
 
const uint16_t port_to_dir[] = {
NOT_A_PORT,
(uint16_t) &P1DIR,
(uint16_t) &P2DIR,
(uint16_t) &P3DIR,
(uint16_t) &P4DIR,
};
 
const uint16_t port_to_ren[] = {
NOT_A_PORT,
(uint16_t) &P1REN,
(uint16_t) &P2REN,
(uint16_t) &P3REN,
(uint16_t) &P4REN,
 
};
 
const uint16_t port_to_sel0[] = {  /* put this PxSEL register under the group of PxSEL0 */
NOT_A_PORT,
(uint16_t) &P1SEL,
(uint16_t) &P2SEL,
(uint16_t) &P3SEL,
(uint16_t) &P4SEL,
};
 
const uint16_t port_to_sel2[] = {
NOT_A_PORT,
#ifdef P1SEL2_
(uint16_t) &P1SEL2,
#else
        NOT_A_PORT,
#endif
#ifdef P2SEL2_
(uint16_t) &P2SEL2,
#else 
        NOT_A_PORT,
#endif
#ifdef P3SEL2_
(uint16_t) &P3SEL2,
#else
        NOT_A_PORT,
#endif
#ifdef P4SEL2_
(uint16_t) &P4SEL2,
#else
        NOT_A_PORT,
#endif
};
 
 
/* 
 * Defines for devices with 2x TA3 timers (e.g. MSP430g2553). On the 20pin devices, upto 3 analog outputs are available
 * T0A1, T1A1 and T1A2 
 */
const uint8_t digital_pin_to_timer[] = {
NOT_ON_TIMER, /*  dummy */
NOT_ON_TIMER, /*  1 - TEST */
NOT_ON_TIMER, /*  2 - VCC */
T1A0,         /*  3 - P2.5, note: A0 output cannot be used with analogWrite */
NOT_ON_TIMER, /*  4 - GND */
NOT_ON_TIMER, /*  5 - P2.7 */
NOT_ON_TIMER, /*  6 - P2.6 */
NOT_ON_TIMER, /*  7 - RST  */
NOT_ON_TIMER, /*  8 - P2.0 */
NOT_ON_TIMER, /*  9 - P2.1 */
T0A1,         /* 10 - P2.2 */
NOT_ON_TIMER, /* 11 - P3,0 note: A0 output cannot be used with analogWrite  */
NOT_ON_TIMER, /* 12 - P3.1 */
NOT_ON_TIMER, /* 13 - P3.2 */
NOT_ON_TIMER, /* 14 - P3.3 */
NOT_ON_TIMER, /* 15 - AGND */
NOT_ON_TIMER, /* 16 - AVCC*/
T0B0,         /* 18 - P4.0 */
T1B1,         /* 18 - P4.1 */
T0B2,         /* 19 - P4.2 */
T0B0,         /* 20 - P4.3 */
T0B1,         /* 21 - P4.4 */
T0B2,         /* 22 - P4.5 */
NOT_ON_TIMER, /* 23 - P4.6 */
NOT_ON_TIMER, /* 24 - P4.7 */  
NOT_ON_TIMER, /* 25 - P3.4 */  
NOT_ON_TIMER, /* 26 - P3.5 */
T1A1,         /* 27 - P3.6 */
T1A2,         /* 28 - P3.7 */
T0A1,         /* 29 - P2.3 */
T0A2,         /* 30 - P2.4 */
NOT_ON_TIMER, /* 31 - P1.0 */
T0A0,         /* 32 - P1.1 */
T0A1,         /* 33 - P1.2 */
T0A2,         /* 34 - P1.3 */
NOT_ON_TIMER, /* 35 - P1.4 */
T0A0,         /* 36 - P1.5 */
T0A1,         /* 37 - P1.6 */
T0A2,         /* 38 - P1.7 */
};
 
const uint8_t digital_pin_to_port[] = {
NOT_A_PIN, /* dummy */
NOT_A_PIN, /* 1 */
NOT_A_PIN, /* 2 */
P2, /* 3 */
NOT_A_PIN, /* 4 */
P2, /* 5 */
P2, /* 6 */
NOT_A_PIN, /* 7 */
P2, /* 8 */
P2, /* 9 */
P2, /* 10 */
P3, /* 11 */
P3, /* 12 */
P3, /* 13 */
P3, /* 14 */
NOT_A_PIN, /* 15 */
NOT_A_PIN, /* 16 */
P4, /* 17 */
P4, /* 18 */
P4, /* 19 */
P4, /* 20 */
P4, /* 21 */
P4, /* 22 */
P4, /* 23 */
P4, /* 24 */
P3, /* 25 */
P3, /* 26 */
P3, /* 27 */
P3, /* 28 */ 
P2, /* 29 */ 
P2, /* 30 */ 
P1, /* 31 */ 
P1, /* 32 */ 
P1, /* 33 */ 
P1, /* 34 */ 
P1, /* 35 */ 
P1, /* 36 */ 
P1, /* 37 */ 
P1, /* 38 */ 
};
 
const uint8_t digital_pin_to_bit_mask[] = {
NOT_A_PIN, /* 0,  pin count starts at 1 */
NOT_A_PIN, /* 1,  TEST */
NOT_A_PIN, /* 2,  VCC */
BV(5),     /* 3,  port P2.5 */
NOT_A_PIN, /* 4,  GND */
BV(7),     /* 5,  port P2.7*/
BV(6),     /* 6,  port P2.7 */
NOT_A_PIN, /* 7,  RST */
BV(0),     /* 8,  port P2.0 */
BV(1),     /* 9,  port P2.1 */
BV(2),     /* 10, port P2.2 */
BV(0),     /* 11, port P3.0 */
BV(1),     /* 12, port P3.1 */
BV(2),     /* 13, port P3.2 */
BV(3),     /* 14, port P3.3 */
NOT_A_PIN, /* 15, AGND */
NOT_A_PIN, /* 16, AVCC */
BV(0),     /* 17, port P4.0 */
BV(1),     /* 18, port P4.1 */
BV(2),     /* 19, port P4.2 */
BV(3),     /* 20, port P4.3 */
BV(4),     /* 21, port P4.4 */
BV(5),     /* 22, port P4.5 */
BV(6),     /* 23, port P4.6 */
BV(7),     /* 24, port P4.7 */
BV(4),     /* 25, port P3.4 */
BV(5),     /* 26, port P3.5 */
BV(6),     /* 27, port P3.6 */
BV(7),     /* 28, port P3.7 */
BV(3),     /* 29, port P2.3 */
BV(4),     /* 30, port P2.4 */
BV(0),     /* 31, port P1.0 */
BV(1),     /* 32, port P1.1 */
BV(2),     /* 33, port P1.2 */
BV(3),     /* 34, port P1.3 */
BV(4),     /* 35, port P1.4 */
BV(5),     /* 36, port P1.5 */
BV(6),     /* 37, port P1.6 */
BV(7),     /* 38, port P1.7 */
};
#endif
#endif

Share this post


Link to post
Share on other sites

There is not pin mapping at the moment for the 28 pin TSOP and 32 pin QFN packages. It is fairly easy to make this work with the 28 pin TSOP by creating another variant with a modified pins_energia.h.

Out of curiosity, what board are you using that has the 28 pin device on it?

 

Just in case you didn't find it yet, here is the pin map for the 20 PDIP package that is on the Launchpad.

https://github.com/energia/Energia/wiki/Hardware#wiki-LaunchPad_MSP430G2553

 

Hi,

 

I am using FR5739 with CC3000 evaluation module with Energia IDE. Problem I am facing is that Pin2.3 on Fraunchpad is connected to wifi module but is not present in the pin mapping. So I would like to modify the default pin mapping and include pin 2.3. How do you assign uint8_t variable to a pin?

Share this post


Link to post
Share on other sites

Easiest would be to create another board, add it to the board.txt and edit the pinmap to add the pins for the RF connector.

I would add the RF connector as an additional header. The last pin number in the map is 30. Create another pin map with all the pins of the RF connector starting at pin number 30. So pin 30 in the pin map would be pin 1 of the RF connector. There will be some duplicates since some of the pins are already on the other headers but that is OK. You can then either address them with the pin number from the header 1/2 or address them with the pin number from the RF connector.

Share this post


Link to post
Share on other sites

Hi all,

I have a problem with pin map 430g2553 28 PIN

What should i do to use this wth Energia ?

 

Hi,

 I know it an old post.  I ran into problem when compiled this "Variant" launchpad.

 

I got these error from twi.c

 

G:\Energia\energia-0101E0017\hardware\msp430\cores\msp430\twi.c: In function 'twi_init_port':
G:\Energia\energia-0101E0017\hardware\msp430\cores\msp430\twi.c:218:15: error: 'TWISDA0' undeclared (first use in this function)
G:\Energia\energia-0101E0017\hardware\msp430\cores\msp430\twi.c:218:15: note: each undeclared identifier is reported only once for each function it appears in
G:\Energia\energia-0101E0017\hardware\msp430\cores\msp430\twi.c:218:24: error: 'TWISDA0_SET_MODE' undeclared (first use in this function)
G:\Energia\energia-0101E0017\hardware\msp430\cores\msp430\twi.c:219:15: error: 'TWISCL0' undeclared (first use in this function)
G:\Energia\energia-0101E0017\hardware\msp430\cores\msp430\twi.c:219:24: error: 'TWISCL0_SET_MODE' undeclared (first use in this function)
 
Did you run into these errors ?  Thanks for reading.

Share this post


Link to post
Share on other sites

//28 Pins

 

 

/*
  ************************************************************************
  * pins_energia.h
  *
  * Energia core files for MSP430
  * Copyright

Share this post


Link to post
Share on other sites

//32 pins

 

/*
  ************************************************************************
  * pins_energia.h
  *
  * Energia core files for MSP430
  * Copyright

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×