
-
UID:1023450
-
- 注册时间2011-12-16
- 最后登录2022-04-17
- 在线时间2350小时
-
-
访问TA的空间加好友用道具
|
一、缘由: 1 不久前看到xb二手的两块板子:MSP430F5438A和 MK60DN512ZVLL10均是白菜价,便捡了回来: 其中 MSP430F5438开发板 mcu为 MSP430F5438A,256K flash 16kram 25M主频,32768hz RTC 晶振,板载一个红外接收,pl2303usb转串口并有跳线转换成BSL下载; 2 官方 arduino ide并不支持msp系列,TI出了个arduino兼容的环境:Energia,虽然不直接支持msp430f5438a芯片,但支持F5529 5739 5969 这些F5系芯片,所以我们可以很方便添加对msp430f5438a的支持; 二、 将MSP430纳入ARDUINO IDE 步骤: 1 添加原有 cores、libraries库和 variants:在arduino\hardware下建立一个文件夹 energia,并将energia\hardware中msp430文件夹拷贝过来;顺便将 lm4f 也拷贝过来(这样这两个系列的mcu以后可以直接在arduino下开发了; 2 拷贝MSP GCC 工具链:将energia\hardware\tools 下的msp430文件夹,拷贝至 arduino\hardware\tools 中; 3 修改arduino\hardware\energia\msp430\boards.txt: 4 engeria ide中生产目标代码是通过make文件,而arduino 则是通过 platform.txt 来配置,因此这个文件我们必须自己来写,msp gcc 和avr gcc 及arm gcc用法几乎一样,因此我们可以直接用上述文件夹中的一个拿来作为样板进行修改,完成后的代码: 5 现在可以看看将msp纳入arduino 是否已经成功,除430f5438a还不行外,验证 其他mcu 应该可以正确通过编译了; 三、增加对 msp430f5438a的支持: 1 在 boards.txt 和 platform.txt 中已经修改好了,我们只有增加 相应的variants就可以了; 2 在 arduino\hardware\energia\msp430\variants 中,增加一个文件夹:launchpad_f5438(可以起别的名字,但要和boards.txt中定义对应); 3 在上述launchpad_f5438文件夹中增加个文件:pins_energia.h: - /*
- ************************************************************************
- * pins_energia.h
- *
- * Pin definition functions for LaunchPad w/ msp430f5438a
- * Copyright (c) 2015 Robert Wessels. All right reserved.
- *
- * Contribution: Stefan Sch
- *
- ***********************************************************************
- 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
- */
- /*
- for MSP430F5438A by huawei<huaweiwx@sina.com> 2016.8.20
- */
- #ifndef Pins_Energia_h
- #define Pins_Energia_h
- #ifndef BV
- #define BV(x) (1 << (x))
- #endif
- //all pins
- enum {
- P1_0,P1_1,P1_2,P1_3,P1_4,P1_5,P1_6,P1_7,
- P2_0,P2_1,P2_2,P2_3,P2_4,P2_5,P2_6,P2_7,
- P3_0,P3_1,P3_2,P3_3,P3_4,P3_5,P3_6,P3_7,
- P4_0,P4_1,P4_2,P4_3,P4_4,P4_5,P4_6,P4_7,
- P5_0,P5_1,P5_2,P5_3,P5_4,P5_5,P5_6,P5_7,
- P6_0,P6_1,P6_2,P6_3,P6_4,P6_5,P6_6,P6_7,
- P7_0,P7_1,P7_2,P7_3,P7_4,P7_5,P7_6,P7_7,
- P8_0,P8_1,P8_2,P8_3,P8_4,P8_5,P8_6,P8_7,
- P9_0,P9_1,P9_2,P9_3,P9_4,P9_5,P9_6,P9_7,
- P10_0,P10_1,P10_2,P10_3,P10_4,P10_5,P10_6,P10_7,
- P11_0,P11_1,P11_2,
- PJ_0,PJ_1,PJ_2,PJ_3,
- };
- #define BOTTON P2_7
- #define LED_BUILTIN8 P10_7
- #define LED_BUILTIN7 P10_6
- #define LED_BUILTIN6 P10_5
- #define LED_BUILTIN5 P10_4
- #define LED_BUILTIN4 P10_3
- #define LED_BUILTIN3 P10_2
- #define LED_BUILTIN2 P10_1
- #define LED_BUILTIN1 P10_0
- #define LED_BUILTIN P10_0
- #define TEMPSENSOR (128 + 10)
- //#if defined(__MSP430_HAS_USCI_B0__) && defined(__MSP430_HAS_USCI_B1__)
- static const uint8_t SS = P3_0; /* P3.0 */
- static const uint8_t SCK = P3_3; /* P3.3 */
- static const uint8_t MOSI = P3_1; /* P3.1 aka SIMO */
- static const uint8_t MISO = P3_2; /* P3.2 aka SOMI */
- static const uint8_t TWISDA0 = P3_1; /* P3.1 UCB0 */
- static const uint8_t TWISCL0 = P3_2; /* P3.3 UCB0 */
- //USCI_B1
- static const uint8_t SS1 = P3_6; /* P3.6 */
- static const uint8_t SCK1 = P5_5; /* P5.5 */
- static const uint8_t MOSI1 = P3_7; /* P3.7 aka SIMO */
- static const uint8_t MISO1 = P5_4; /* P5.4 aka SOMI */
- static const uint8_t TWISDA1 = P3_7; /* P3.7 UCB1 */
- static const uint8_t TWISCL1 = P3_6; /* P3.6 UCB1 */
- #define TWISDA0_SET_MODE (PORT_SELECTION0 | INPUT_PULLUP)
- #define TWISCL0_SET_MODE (PORT_SELECTION0 | INPUT_PULLUP)
- #define TWISDA1_SET_MODE (PORT_SELECTION1 | INPUT_PULLUP)
- #define TWISCL1_SET_MODE (PORT_SELECTION1 | INPUT_PULLUP)
- #define SPISCK_SET_MODE (PORT_SELECTION0)
- #define SPIMOSI_SET_MODE (PORT_SELECTION0)
- #define SPIMISO_SET_MODE (PORT_SELECTION0)
- /* Define the default I2C settings */
- #define DEFAULT_I2C 1
- #define TWISDA TWISDA1
- #define TWISCL TWISCL1
- #define TWISDA_SET_MODE TWISDA1_SET_MODE
- #define TWISCL_SET_MODE TWISCL1_SET_MODE
- //#endif
- //#if defined(__MSP430_HAS_USCI_A0__) || defined(__MSP430_HAS_USCI_A1__)
- static const uint8_t DEBUG_UARTRXD = P3_5; /* Receive Data (RXD) at P3.5 */
- static const uint8_t DEBUG_UARTTXD = P3_4; /* Transmit Data (TXD) at P3.4 */
- static const uint8_t AUX_UARTRXD = P5_6; /* Receive Data (RXD) at P5.6 */
- static const uint8_t AUX_UARTTXD = P5_7; /* Transmit Data (TXD) at P5.7 */
- #define DEBUG_UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
- #define DEBUG_UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
- #define AUX_UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
- #define AUX_UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
- #define DEBUG_UART_MODULE_OFFSET 0x20
- #define AUX_UART_MODULE_OFFSET 0x00
- #define SERIAL1_AVAILABLE 1
- //#endif
- #if defined(__MSP430_HAS_USCI_B2__)|| defined(__MSP430_HAS_USCI_B3__)
- #endif
- #if defined(__MSP430_HAS_USCI_A2__)|| defined(__MSP430_HAS_USCI_A3__)
- #endif
- /* Analog pins */
- static const uint8_t A0 = P6_0;
- static const uint8_t A1 = P6_1;
- static const uint8_t A2 = P6_2;
- static const uint8_t A3 = P6_3;
- static const uint8_t A4 = P6_4;
- static const uint8_t A5 = P6_5;
- static const uint8_t A6 = P6_6;
- static const uint8_t A7 = P6_7;
- static const uint8_t A8 = P5_0;
- static const uint8_t A9 = P5_1;
- static const uint8_t A10 = 128+0x0a; //A10 Temperature
- static const uint8_t A11 = 128+0x0b; //A11 Built-In VMID
- static const uint8_t A12 = P7_4;
- static const uint8_t A13 = P7_5;
- static const uint8_t A14 = P7_6;
- static const uint8_t A15 = P7_7;
- /* Pin names based on the silkscreen */
- #ifdef ARDUINO_MAIN
- const uint16_t port_to_input[] = {
- NOT_A_PORT,
- (uint16_t) &P1IN,
- (uint16_t) &P2IN,
- (uint16_t) &P3IN,
- (uint16_t) &P4IN,
- (uint16_t) &P5IN,
- (uint16_t) &P6IN,
- (uint16_t) &P7IN,
- (uint16_t) &P8IN,
- (uint16_t) &P9IN,
- (uint16_t) &P10IN,
- (uint16_t) &P11IN,
- (uint16_t) &PJIN,
- };
- const uint16_t port_to_output[] = {
- NOT_A_PORT,
- (uint16_t) &P1OUT,
- (uint16_t) &P2OUT,
- (uint16_t) &P3OUT,
- (uint16_t) &P4OUT,
- (uint16_t) &P5OUT,
- (uint16_t) &P6OUT,
- (uint16_t) &P7OUT,
- (uint16_t) &P8OUT,
- (uint16_t) &P9OUT,
- (uint16_t) &P10OUT,
- (uint16_t) &P11OUT,
- (uint16_t) &PJOUT,
- };
- const uint16_t port_to_dir[] = {
- NOT_A_PORT,
- (uint16_t) &P1DIR,
- (uint16_t) &P2DIR,
- (uint16_t) &P3DIR,
- (uint16_t) &P4DIR,
- (uint16_t) &P5DIR,
- (uint16_t) &P6DIR,
- (uint16_t) &P7DIR,
- (uint16_t) &P8DIR,
- (uint16_t) &P9DIR,
- (uint16_t) &P10DIR,
- (uint16_t) &P11DIR,
- (uint16_t) &PJDIR,
- };
- const uint16_t port_to_ren[] = {
- NOT_A_PORT,
- (uint16_t) &P1REN,
- (uint16_t) &P2REN,
- (uint16_t) &P3REN,
- (uint16_t) &P4REN,
- (uint16_t) &P5REN,
- (uint16_t) &P6REN,
- (uint16_t) &P7REN,
- (uint16_t) &P8REN,
- (uint16_t) &P9REN,
- (uint16_t) &P11REN,
- (uint16_t) &P10REN,
- (uint16_t) &PJREN,
- };
- 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,
- (uint16_t) &P5SEL,
- (uint16_t) &P6SEL,
- (uint16_t) &P7SEL,
- (uint16_t) &P8SEL,
- (uint16_t) &P9SEL,
- (uint16_t) &P10SEL,
- (uint16_t) &P11SEL,
- NOT_A_PORT,
- };
- const uint8_t digital_pin_to_timer[] = {
- T0A0, /* 17 - P1.0 */
- T0A1, /* 18 - P1.1 */
- T0A2, /* 19 - P1.2 */
- T0A3, /* 20 - P1.3 */
- T0A4, /* 21 - P1.4 - note: CCR0 output cannot be used with analogWrite */
- NOT_ON_TIMER, /* 22 - P1.5 - note: CCR0 output cannot be used with analogWrite */
- NOT_ON_TIMER, /* 23 - P1.6 */ //T0A1_SEL01,
- NOT_ON_TIMER, /* 24 - P1.7 */ //T0A2_SEL01,
-
- T1A0, /* 25 - P2.0 */ //T1B6_SEL1,
- T1A1, /* 26 - P2.1 */ //T0B5_SEL1,
- T1A2, /* 27 - P2.2 */ //T0B4_SEL1,
- NOT_ON_TIMER, /* 28 - P2.3 */
- NOT_ON_TIMER, /* 29 - P2.4 */
- NOT_ON_TIMER, /* 30 - P2.5 */
- NOT_ON_TIMER, /* 31 - P2.6 */
- NOT_ON_TIMER, /* 32 - P2.7 */
-
- NOT_ON_TIMER, /* 33 - P3.0 */
- NOT_ON_TIMER, /* 34 - P3.1 */
- NOT_ON_TIMER, /* 35 - P3.2 */
- NOT_ON_TIMER, /* 36 - P3.3 */
- /* 39 - P3.4 */
- NOT_ON_TIMER, /* 40 - P3.5 */
- NOT_ON_TIMER, /* 41 - P3.6 */
- NOT_ON_TIMER, /* 42 - P3.7 */
- T0B0, /* 43 - P4.0 */
- T0B1, /* 44 - P4.1 */
- T0B2, /* 45 - P4.2 */
- T0B3, /* 46 - P4.3 */
- T0B4, /* 47 - P4.4 */
- T0B5, /* 48 - P4.5 */
- NOT_ON_TIMER, /* 49 - P4.6 */
- NOT_ON_TIMER, /* 50 - P4.7 */
-
- NOT_ON_TIMER, /* 9 - P5.0 */
- NOT_ON_TIMER, /* 10 - P5.1 */
- NOT_ON_TIMER, /* 89 - P5.2 */
- NOT_ON_TIMER, /* 90 - P5.3 */
- NOT_ON_TIMER, /* 51 - P5.4 */
- NOT_ON_TIMER, /* 52 - P5.5 */
- NOT_ON_TIMER, /* 53 - P5.6 */
- NOT_ON_TIMER, /* 54 - P5.7 */
- NOT_ON_TIMER, /* 97 - P6.0 */
- NOT_ON_TIMER, /* 98 - P6.1 */
- NOT_ON_TIMER, /* 99 - P6.2 */
- NOT_ON_TIMER, /* 100 - P6.3 */
- NOT_ON_TIMER, /* 1 - P6.4 */
- NOT_ON_TIMER, /* 2 - P6.5 */
- NOT_ON_TIMER, /* 3 - P6.6 */
- NOT_ON_TIMER,/* 4 - P6.7 */
-
- NOT_ON_TIMER,/* 13 - P7.0 XIN*/
- NOT_ON_TIMER,/* 14 - P7.1 XOUT*/
- NOT_ON_TIMER,/* 55 - P7.2 */
- T1A2_SEL01 ,/* 56 - P7.3 */
- NOT_ON_TIMER,/* 5 - P7.4 */
- NOT_ON_TIMER,/* 6 - P7.5 */
- NOT_ON_TIMER,/* 7 - P7.6 */
- NOT_ON_TIMER,/* 8 - P7.7 */
-
- T0A0_SEL01, /* 57 - P8.0 */
- T0A1_SEL01, /* 58 - P8.1 */
- T0A2_SEL01, /* 59 - P8.2 */
- T0A3_SEL01, /* 60 - P8.3 */
- T0A4_SEL01, /* 61 - P8.4 */
- T1A0_SEL01 ,/* 65 - P8.5 */
- T1A1_SEL01 ,/* 66 - P8.6 */
- NOT_ON_TIMER, /* 67 - P8.7 */
-
- NOT_ON_TIMER, /* 68 - P9.0 */
- NOT_ON_TIMER, /* 69 - P9.1 */
- NOT_ON_TIMER, /* 70 - P9.2 */
- NOT_ON_TIMER, /* 71 - P9.3 */
- NOT_ON_TIMER, /* 72 - P9.4 */
- NOT_ON_TIMER, /* 73 - P9.5 */
- NOT_ON_TIMER, /* 73 - P9.6 */
- NOT_ON_TIMER, /* 75 - P9.7 */
-
- NOT_ON_TIMER, /* 76 - P10.0 */
- NOT_ON_TIMER, /* 77 - P10.1 */
- NOT_ON_TIMER, /* 78 - P10.2 */
- NOT_ON_TIMER, /* 79 - P10.3 */
- NOT_ON_TIMER, /* 80 - P10.4 */
- NOT_ON_TIMER, /* 81 - P10.5 */
- NOT_ON_TIMER, /* 82 - P10.6 */
- NOT_ON_TIMER, /* 83 - P10.7 */
-
- NOT_ON_TIMER, /* 84 - P11.0 */
- NOT_ON_TIMER, /* 85 - P11.1 */
- NOT_ON_TIMER, /* 86 - P11.2 */
-
- NOT_ON_TIMER, /* 92 - PJ.0 */
- NOT_ON_TIMER, /* 93 - PJ.1 */
- NOT_ON_TIMER, /* 94 - PJ.2 */
- NOT_ON_TIMER, /* 95 - PJ.3 */
- };
- const uint8_t digital_pin_to_port[] = {
- P1, /* 17 - P1.0 */
- P1, /* 18 - P1.1 */
- P1, /* 19 - P1.2 */
- P1, /* 20 - P1.3 */
- P1, /* 21 - P1.4 */
- P1, /* 22 - P1.5 */
- P1, /* 23 - P1.6 */
- P1, /* 24 - P1.7 */
-
- P2, /* 25 - P2.0 */
- P2, /* 26 - P2.1 */
- P2, /* 27 - P2.2 */
- P2, /* 28 - P2.3 */
- P2, /* 29 - P2.4 */
- P2, /* 30 - P2.5 */
- P2, /* 31 - P2.6 */
- P2, /* 32 - P2.7 */
-
- P3, /* 33 - P3.0 */
- P3, /* 34 - P3.1 */
- P3, /* 35 - P3.2 */
- P3, /* 36 - P3.3 */
- P3, /* 39 - P3.4 */
- P3, /* 40 - P3.5 */
- P3, /* 41 - P3.6 */
- P3, /* 42 - P3.7 */
-
- P4, /* 43 - P4.0 */
- P4, /* 44 - P4.1 */
- P4, /* 45 - P4.2 */
- P4, /* 46 - P4.3 */
- P4, /* 47 - P4.4 */
- P4, /* 48 - P4.5 */
- P4, /* 49 - P4.6 */
- P4, /* 50 - P4.7 */
-
- P5, /* 9 - P5.0 */
- P5, /* 10 - P5.1 */
- P5, /* 89 - P5.2 */
- P5, /* 90 - P5.3 */
- P5, /* 51 - P5.4 */
- P5, /* 52 - P5.5 */
- P5, /* 53 - P5.6 */
- P5, /* 54 - P5.7 */
- P6, /* 97 - P6.0 */
- P6, /* 98 - P6.1 */
- P6, /* 99 - P6.2 */
- P6, /* 100 - P6.3 */
- P6, /* 1 - P6.4 */
- P6, /* 2 - P6.5 */
- P6, /* 3 - P6.6 */
- P6, /* 4 - P6.7 */
-
- P7, /* 13 - P7.0 XIN*/
- P7, /* 14 - P7.1 XOUT*/
- P7, /* 55 - P7.2 */
- P7, /* 56 - P7.3 */
- P7, /* 5 - P7.4 */
- P7, /* 6 - P7.5 */
- P7, /* 7 - P7.6 */
- P7, /* 8 - P7.7 */
- P8, /* 57 - P8.0 */
- P8, /* 58 - P8.1 */
- P8, /* 59 - P8.2 */
- P8, /* 60 - P8.3 */
- P8, /* 61 - P8.4 */
- P8, /* 65 - P8.5 */
- P8, /* 66 - P8.6 */
- P8, /* 67 - P8.7 */
-
- P9, /* 68 - P9.0 */
- P9, /* 69 - P9.1 */
- P9, /* 70 - P9.2 */
- P9, /* 71 - P9.3 */
- P9, /* 72 - P9.4 */
- P9, /* 73 - P9.5 */
- P9, /* 73 - P9.6 */
- P9, /* 75 - P9.7 */
-
- P10, /* 76 - P10.0 */
- P10, /* 77 - P10.1 */
- P10, /* 78 - P10.2 */
- P10, /* 79 - P10.3 */
- P10, /* 80 - P10.4 */
- P10, /* 81 - P10.5 */
- P10, /* 82 - P10.6 */
- P10, /* 83 - P10.7 */
-
- P11, /* 84 - P11.0 */
- P11, /* 85 - P11.1 */
- P11, /* 86 - P11.2 */
-
- PJ, /* 92 - PJ.0 */
- PJ, /* 93 - PJ.1 */
- PJ, /* 94 - PJ.2 */
- PJ, /* 95 - PJ.3 */
- };
- const uint8_t digital_pin_to_bit_mask[] = {
- BV(0), /* 17 - P1.0 */
- BV(1), /* 18 - P1.1 */
- BV(2), /* 19 - P1.2 */
- BV(3), /* 20 - P1.3 */
- BV(4), /* 21 - P1.4 */
- BV(5), /* 22 - P1.5 */
- BV(6), /* 23 - P1.6 */
- BV(7), /* 24 - P1.7 */
-
- BV(0), /* 25 - P2.0 */
- BV(1), /* 26 - P2.1 */
- BV(2), /* 27 - P2.2 */
- BV(3), /* 28 - P2.3 */
- BV(4), /* 29 - P2.4 */
- BV(5), /* 30 - P2.5 */
- BV(6), /* 31 - P2.6 */
- BV(7), /* 32 - P2.7 */
-
- BV(0), /* 33 - P3.0 */
- BV(1), /* 34 - P3.1 */
- BV(2), /* 35 - P3.2 */
- BV(3), /* 36 - P3.3 */
- BV(4), /* 39 - P3.4 */
- BV(5), /* 40 - P3.5 */
- BV(6), /* 41 - P3.6 */
- BV(7), /* 42 - P3.7 */
-
- BV(0), /* 43 - P4.0 */
- BV(1), /* 44 - P4.1 */
- BV(2), /* 45 - P4.2 */
- BV(3), /* 46 - P4.3 */
- BV(4), /* 47 - P4.4 */
- BV(5), /* 48 - P4.5 */
- BV(6), /* 49 - P4.6 */
- BV(7), /* 50 - P4.7 */
-
- BV(0), /* 9 - P5.0 */
- BV(1), /* 10 - P5.1 */
- BV(2), /* 89 - P5.2 */
- BV(3), /* 90 - P5.3 */
- BV(4), /* 51 - P5.4 */
- BV(5), /* 52 - P5.5 */
- BV(6), /* 53 - P5.6 */
- BV(7), /* 54 - P5.7 */
-
- BV(0), /* 97 - P6.0 */
- BV(1), /* 98 - P6.1 */
- BV(2), /* 99 - P6.2 */
- BV(3), /* 100 - P6.3 */
- BV(4), /* 1 - P6.4 */
- BV(5), /* 2 - P6.5 */
- BV(6), /* 3 - P6.6 */
- BV(7), /* 4 - P6.7 */
-
- BV(0), /* 13 - P7.0 XIN*/
- BV(1), /* 14 - P7.1 XOUT*/
- BV(2), /* 55 - P7.2 */
- BV(3), /* 56 - P7.3 */
- BV(4), /* 5 - P7.4 */
- BV(5), /* 6 - P7.5 */
- BV(6), /* 7 - P7.6 */
- BV(7), /* 8 - P7.7 */
-
- BV(0), /* 57 - P8.0 */
- BV(1), /* 58 - P8.1 */
- BV(2), /* 59 - P8.2 */
- BV(3), /* 60 - P8.3 */
- BV(4), /* 61 - P8.4 */
- BV(5), /* 65 - P8.5 */
- BV(6), /* 66 - P8.6 */
- BV(7), /* 67 - P8.7 */
-
- BV(0), /* 68 - P9.0 */
- BV(1), /* 69 - P9.1 */
- BV(2), /* 70 - P9.2 */
- BV(3), /* 71 - P9.3 */
- BV(4), /* 72 - P9.4 */
- BV(5), /* 73 - P9.5 */
- BV(6), /* 74 - P9.6 */
- BV(7), /* 75 - P9.7 */
-
- BV(0), /* 76 - P10.0 */
- BV(1), /* 77 - P10.1 */
- BV(2), /* 78 - P10.2 */
- BV(3), /* 79 - P10.3 */
- BV(4), /* 80 - P10.4 */
- BV(5), /* 81 - P10.5 */
- BV(6), /* 82 - P10.6 */
- BV(7), /* 83 - P10.7 */
-
- BV(0), /* 84 - P11.0 */
- BV(1), /* 85 - P11.1 */
- BV(2), /* 86 - P11.2 */
-
- BV(0), /* 92 - PJ.0 */
- BV(1), /* 93 - PJ.1 */
- BV(2), /* 94 - PJ.2 */
- BV(3), /* 95 - PJ.3 */
- };
- const uint32_t digital_pin_to_analog_in[] = {
- NOT_ON_ADC, /* 17 - P1.0 */
- NOT_ON_ADC, /* 18 - P1.1 */
- NOT_ON_ADC, /* 19 - P1.2 */
- NOT_ON_ADC, /* 20 - P1.3 */
- NOT_ON_ADC, /* 21 - P1.4 */
- NOT_ON_ADC, /* 22 - P1.5 */
- NOT_ON_ADC, /* 23 - P1.6 */
- NOT_ON_ADC, /* 24 - P1.7 */
-
- NOT_ON_ADC, /* 25 - P2.0 */
- NOT_ON_ADC, /* 26 - P2.1 */
- NOT_ON_ADC, /* 27 - P2.2 */
- NOT_ON_ADC, /* 28 - P2.3 */
- NOT_ON_ADC, /* 29 - P2.4 */
- NOT_ON_ADC, /* 30 - P2.5 */
- NOT_ON_ADC, /* 31 - P2.6 */
- NOT_ON_ADC, /* 32 - P2.7 */
-
- NOT_ON_ADC, /* 33 - P3.0 */
- NOT_ON_ADC, /* 34 - P3.1 */
- NOT_ON_ADC, /* 35 - P3.2 */
- NOT_ON_ADC, /* 36 - P3.3 */
- NOT_ON_ADC, /* 39 - P3.4 */
- NOT_ON_ADC, /* 40 - P3.5 */
- NOT_ON_ADC, /* 41 - P3.6 */
- NOT_ON_ADC, /* 42 - P3.7 */
-
- NOT_ON_ADC, /* 43 - P4.0 */
- NOT_ON_ADC, /* 44 - P4.1 */
- NOT_ON_ADC, /* 45 - P4.2 */
- NOT_ON_ADC, /* 46 - P4.3 */
- NOT_ON_ADC, /* 47 - P4.4 */
- NOT_ON_ADC, /* 48 - P4.5 */
- NOT_ON_ADC, /* 49 - P4.6 */
- NOT_ON_ADC, /* 50 - P4.7 */
-
- 8, /* 9 - P5.0 */
- 9, /* 10 - P5.1 */
- NOT_ON_ADC, /* 89 - P5.2 */
- NOT_ON_ADC, /* 90 - P5.3 */
- NOT_ON_ADC, /* 51 - P5.4 */
- NOT_ON_ADC, /* 52 - P5.5 */
- NOT_ON_ADC, /* 53 - P5.6 */
- NOT_ON_ADC, /* 54 - P5.7 */
-
- 0, /* 97 - P6.0 */
- 1, /* 98 - P6.1 */
- 2, /* 99 - P6.2 */
- 3, /* 100 - P6.3 */
- 4, /* 1 - P6.4 */
- 5, /* 2 - P6.5 */
- 6, /* 3 - P6.6 */
- 7, /* 4 - P6.7 */
-
- NOT_ON_ADC, /* 13 - P7.0 XIN*/
- NOT_ON_ADC, /* 14 - P7.1 XOUT*/
- NOT_ON_ADC, /* 55 - P7.2 */
- NOT_ON_ADC, /* 56 - P7.3 */
- 12, /* 5 - P7.4 */
- 13, /* 6 - P7.5 */
- 14, /* 7 - P7.6 */
- 15, /* 8 - P7.7 */
-
- NOT_ON_ADC, /* 57 - P8.0 */
- NOT_ON_ADC, /* 58 - P8.1 */
- NOT_ON_ADC, /* 59 - P8.2 */
- NOT_ON_ADC, /* 60 - P8.3 */
- NOT_ON_ADC, /* 61 - P8.4 */
- NOT_ON_ADC, /* 65 - P8.5 */
- NOT_ON_ADC, /* 66 - P8.6 */
- NOT_ON_ADC, /* 67 - P8.7 */
-
- NOT_ON_ADC, /* 68 - P9.0 */
- NOT_ON_ADC, /* 69 - P9.1 */
- NOT_ON_ADC, /* 70 - P9.2 */
- NOT_ON_ADC, /* 71 - P9.3 */
- NOT_ON_ADC, /* 72 - P9.4 */
- NOT_ON_ADC, /* 73 - P9.5 */
- NOT_ON_ADC, /* 74 - P9.6 */
- NOT_ON_ADC, /* 75 - P9.7 */
-
- NOT_ON_ADC, /* 76 - P10.0 */
- NOT_ON_ADC, /* 77 - P10.1 */
- NOT_ON_ADC, /* 78 - P10.2 */
- NOT_ON_ADC, /* 79 - P10.3 */
- NOT_ON_ADC, /* 80 - P10.4 */
- NOT_ON_ADC, /* 81 - P10.5 */
- NOT_ON_ADC, /* 82 - P10.6 */
- NOT_ON_ADC, /* 83 - P10.7 */
-
- NOT_ON_ADC, /* 84 - P11.0 */
- NOT_ON_ADC, /* 85 - P11.1 */
- NOT_ON_ADC, /* 86 - P11.2 */
-
- NOT_ON_ADC, /* 92 - PJ.0 */
- NOT_ON_ADC, /* 93 - PJ.1 */
- NOT_ON_ADC, /* 94 - PJ.2 */
- NOT_ON_ADC, /* 95 - PJ.3 */
- };
- #endif // #ifdef ARDUINO_MAIN
- #endif // #ifndef Pins_Energia_h
四、现在可以正确生成代码了,但目前还不能上传,因为我还没有找到支持 msp430f5438a BSL下载的命令行版本,暂时这样处理: 1 arduno 导出生成的执行代码 hex格式,这是我的设定;(请教MSP GCC 如何直接生成 msp 的TXT格式输出文件? 请坛上有这方面经验的高手不吝赐教!) 2 有个安阳工学院 msp430 ver2.3 gui版本bsl烧写程序,支持msp430f5438a,我就用这个下载;但这个软件只支持 txt执行文件格式,所以又用了另一个下载软件 mspfet 装入hex格式,再另存为txt格式;(先临时这样捣鼓调通了) 附支持的板子jpg : 压缩包就不附了,内容都在上面,如有问题直接和我联系。 另外,关于 LM4F 部分就不在这里介绍了,因为用的坛友很少,如有这方面板子的并感兴趣,直接向我索取。
|