切换到宽版
  • 7540阅读
  • 10回复

[MSP]将MSP430 纳入 ARDUINO IDE: 让arduino支持MSP430F5438A [复制链接]

上一主题 下一主题
离线huaweiwx
 

发帖
1372
M币
2167
专家
65
粉丝
297
只看楼主 倒序阅读 我要置顶 楼主  发表于: 2016-08-28

一、缘由:
   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:
  1. # See: http://code.google.com/p/arduino/wiki/Platforms
  2. menu.cpu=Processor
  3. ##############################################################
  4. lpmsp430f5438_25.vid.0=0x2341
  5. lpmsp430f5438_25.pid.0=0x0c9f
  6. lpmsp430f5438_25.name=MSP-EXP430F5438A
  7. lpmsp430f5438_25.build.mcu=msp430f5438a
  8. lpmsp430f5438_25.build.f_cpu=25000000L
  9. lpmsp430f5438_25.build.core=msp430
  10. lpmsp430f5438_25.build.variant=launchpad_f5438
  11. lpmsp430f5438_25.build.board=MSP430F5438A_EVB
  12. lpmsp430f5438_25.upload.tool=dslite
  13. lpmsp430f5438_25.upload.protocol=dslite
  14. lpmsp430f5438_25.upload.maximum_size=262144
  15. lpmsp430f5438_25.upload.maximum_data_size=16384
  16. ##############################################################
  17. MSP-EXP430F5529LP.vid.0=0x2341
  18. MSP-EXP430F5529LP.pid.0=0x0c9f
  19. MSP-EXP430F5529LP.name=MSP-EXP430F5529LP
  20. MSP-EXP430F5529LP.build.mcu=msp430f5529
  21. MSP-EXP430F5529LP.build.f_cpu=16000000L
  22. MSP-EXP430F5529LP.build.core=msp430
  23. MSP-EXP430F5529LP.build.variant=MSP-EXP430F5529LP
  24. MSP-EXP430F5529LP.build.board=MSP_EXP430F5529LP
  25. MSP-EXP430F5529LP.upload.tool=dslite
  26. MSP-EXP430F5529LP.upload.protocol=dslite
  27. MSP-EXP430F5529LP.upload.maximum_size=131072
  28. MSP-EXP430F5529LP.upload.maximum_data_size=8192
  29. #MSP-EXP430FR4133
  30. MSP-EXP430FR4133LP.vid.0=0x2341
  31. MSP-EXP430FR4133LP.pid.0=0x0c9f
  32. MSP-EXP430FR4133LP.name=MSP-EXP430FR4133LP
  33. MSP-EXP430FR4133LP.build.mcu=msp430fr4133
  34. MSP-EXP430FR4133LP.build.f_cpu=8000000L
  35. MSP-EXP430FR4133LP.build.core=msp430
  36. MSP-EXP430FR4133LP.build.variant=MSP-EXP430FR4133LP
  37. MSP-EXP430FR4133LP.build.board=MSP_EXP430FR4133LP
  38. MSP-EXP430FR4133LP.upload.tool=dslite
  39. MSP-EXP430FR4133LP.upload.protocol=dslite
  40. MSP-EXP430FR4133LP.upload.maximum_size=15360
  41. MSP-EXP430FR4133LP.upload.maximum_data_size=2048
  42. #MSP-EXP430FR5969
  43. MSP-EXP430FR5969LP.vid.0=0x2341
  44. MSP-EXP430FR5969LP.pid.0=0x0c9f
  45. MSP-EXP430FR5969LP.name=MSP-EXP430FR5969LP
  46. MSP-EXP430FR5969LP.build.mcu=msp430fr5969
  47. MSP-EXP430FR5969LP.build.f_cpu=8000000L
  48. MSP-EXP430FR5969LP.build.core=msp430
  49. MSP-EXP430FR5969LP.build.variant=MSP-EXP430FR5969LP
  50. MSP-EXP430FR5969LP.build.board=MSP_EXP430FR5969LP
  51. MSP-EXP430FR5969LP.upload.tool=dslite
  52. MSP-EXP430FR5969LP.upload.protocol=dslite
  53. MSP-EXP430FR5969LP.upload.maximum_size=65536
  54. MSP-EXP430FR5969LP.upload.maximum_data_size=2048
  55. #MSP-EXP430FR5969
  56. MSP-EXP430FR6989LP.vid.0=0x2341
  57. MSP-EXP430FR6989LP.pid.0=0x0c9f
  58. MSP-EXP430FR6989LP.name=MSP-EXP430FR6989LP
  59. MSP-EXP430FR6989LP.build.mcu=msp430fr6989
  60. MSP-EXP430FR6989LP.build.f_cpu=8000000L
  61. MSP-EXP430FR6989LP.build.core=msp430
  62. MSP-EXP430FR6989LP.build.variant=MSP-EXP430FR6989LP
  63. MSP-EXP430FR6989LP.build.board=MSP_EXP430FR6989LP
  64. MSP-EXP430FR6989LP.upload.tool=dslite
  65. MSP-EXP430FR6989LP.upload.protocol=dslite
  66. MSP-EXP430FR6989LP.upload.maximum_size=130048
  67. MSP-EXP430FR6989LP.upload.maximum_data_size=2048
  68. #MSP-EXP430G2553
  69. MSP-EXP430G2553LP.vid.0=0x2341
  70. MSP-EXP430G2553LP.pid.0=0x0c9f
  71. MSP-EXP430G2553LP.name=MSP-EXP430G2553LP
  72. MSP-EXP430G2553LP.build.mcu=msp430g2553
  73. MSP-EXP430G2553LP.build.f_cpu=16000000L
  74. MSP-EXP430G2553LP.build.core=msp430
  75. MSP-EXP430G2553LP.build.variant=MSP-EXP430G2553LP
  76. MSP-EXP430G2553LP.build.board=MSP_EXP430G2553LP
  77. MSP-EXP430G2553LP.upload.tool=mspdebug
  78. MSP-EXP430G2553LP.upload.protocol=rf2500
  79. MSP-EXP430G2553LP.upload.maximum_size=16384
  80. MSP-EXP430G2553LP.upload.maximum_data_size=512
  81. #MSP-EXP430FR5739
  82. MSP-EXP430FR5739LP.vid.0=0x2341
  83. MSP-EXP430FR5739LP.pid.0=0x0c9f
  84. MSP-EXP430FR5739LP.name=MSP-EXP430FR5739LP
  85. MSP-EXP430FR5739LP.build.mcu=msp430fr5739
  86. MSP-EXP430FR5739LP.build.f_cpu=16000000L
  87. MSP-EXP430FR5739LP.build.core=msp430
  88. MSP-EXP430FR5739LP.build.variant=MSP-EXP430FR5739LP
  89. MSP-EXP430FR5739LP.build.board=MSP_EXP430FR5739LP
  90. MSP-EXP430FR5739LP.upload.tool=mspdebug
  91. MSP-EXP430FR5739LP.upload.protocol=rf2500
  92. MSP-EXP430FR5739LP.upload.maximum_size=16384
  93. MSP-EXP430FR5739LP.upload.maximum_data_size=512


4 engeria ide中生产目标代码是通过make文件,而arduino 则是通过 platform.txt 来配置,因此这个文件我们必须自己来写,msp gcc 和avr gcc 及arm gcc用法几乎一样,因此我们可以直接用上述文件夹中的一个拿来作为样板进行修改,完成后的代码:

  1. # Energia MSP430 Core and platform.
  2. # ------------------------------
  3. #
  4. # For more info:
  5. # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification
  6. name=Energia MSP430 boards
  7. version=1.0.6
  8. # AVR compile variables
  9. # ---------------------
  10. compiler.warning_flags=-w
  11. compiler.warning_flags.none=-w
  12. compiler.warning_flags.default=
  13. compiler.warning_flags.more=-Wall
  14. compiler.warning_flags.all=-Wall -Wextra
  15. compiler.mlarge_flag=
  16. #compiler.mlarge_flag=-mlarge
  17. # Default "compiler.path" is correct, change only if you want to overidde the initial value
  18. compiler.path={runtime.ide.path}/hardware/tools/msp430/bin/
  19. compiler.c.cmd=msp430-gcc
  20. compiler.c.flags=-c -g -O2 {compiler.mlarge_flag} {compiler.warning_flags} -ffunction-sections -fdata-sections -MMD
  21. #compiler.c.elf.flags={compiler.warning_flags} -g -O2 -Wl,--gc-sections
  22. compiler.c.elf.flags={compiler.warning_flags} -g -O2 {compiler.mlarge_flag} -fno-rtti -fno-exceptions -Wl,--gc-sections,-u,main
  23. compiler.c.elf.cmd=msp430-gcc
  24. compiler.S.flags=-c -x assembler-with-cpp
  25. compiler.cpp.cmd=msp430-g++
  26. compiler.cpp.flags=-c -g -O2 {compiler.mlarge_flag} {compiler.warning_flags} -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
  27. compiler.ar.cmd=msp430-ar
  28. compiler.ar.flags=rcs
  29. compiler.objcopy.cmd=msp430-objcopy
  30. compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
  31. compiler.elf2hex.flags=-O ihex -R .eeprom
  32. compiler.elf2hex.cmd=msp430-objcopy
  33. compiler.ldflags=
  34. compiler.size.cmd=msp430-size
  35. # This can be overriden in boards.txt
  36. build.extra_flags=
  37. # These can be overridden in platform.local.txt
  38. compiler.c.extra_flags=-I{runtime.tools.msp430-gcc.path}/include
  39. compiler.c.elf.extra_flags=-L{runtime.tools.msp430-gcc.path}/include
  40. compiler.S.extra_flags=
  41. compiler.cpp.extra_flags=-I{runtime.tools.msp430-gcc.path}/include
  42. compiler.ar.extra_flags=
  43. compiler.objcopy.eep.extra_flags=
  44. compiler.elf2hex.extra_flags=
  45. # AVR compile patterns
  46. # --------------------
  47. ## Compile c files
  48. recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
  49. ## Compile c++ files
  50. recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
  51. ## Compile S files
  52. recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
  53. ## Create archives
  54. recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
  55. #recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}"
  56. ## Combine gc-sections, archives, and objects
  57. recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
  58. ## Create output files (.eep and .hex)
  59. recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
  60. recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
  61. ## Save hex
  62. recipe.output.tmp_file={build.project_name}.hex
  63. recipe.output.save_file={build.project_name}.{build.variant}.hex
  64. ## Compute size
  65. recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
  66. recipe.size.regex=^(?:\.text|\.data|\.rodata|\.vectors)\s+([0-9]+).*
  67. recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
  68. recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
  69. ## Preprocessor
  70. preproc.includes.flags=-w -x c++ -M -MG -MP
  71. recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}"
  72. preproc.macros.flags=-w -x c++ -E -CC
  73. recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DENERGIA={runtime.ide.version} -DENERGIA_{build.board} -DENERGIA_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}"
  74. # msp430 Uploader/Programmers tools
  75. # -----------------------------------
  76. # TI's DSLite
  77. tools.dslite.upload.params.verbose=
  78. tools.dslite.upload.params.quiet=
  79. tools.dslite.path={runtime.tools.dslite.path}
  80. tools.dslite.config.path={path}
  81. tools.dslite.cmd.path={path}/DebugServer/bin/DSLite
  82. tools.dslite.upload.pattern={cmd.path} {upload.verbose} load -c "{config.path}/{build.variant}.ccxml" -f "{build.path}/{build.project_name}.elf"
  83. tools.dslite.program.params.verbose=
  84. tools.dslite.program.params.quiet=
  85. tools.dslite.program.params.noverify=
  86. tools.dslite.program.pattern={cmd.path} {program.verbose} load -c "{config.path}/{build.variant}.ccxml" -f "{build.path}/{build.project_name}.elf"
  87. # mspdebug
  88. tools.mspdebug.upload.params.verbose=
  89. tools.mspdebug.upload.params.quiet=
  90. tools.mspdebug.path={runtime.tools.mspdebug.path}
  91. tools.mspdebug.cmd.path={path}/bin/mspdebug
  92. tools.mspdebug.upload.pattern={cmd.path} {upload.verbose} {upload.protocol} --force-reset "prog {build.path}/{build.project_name}.hex"
  93. tools.mspdebug.program.params.verbose=
  94. tools.mspdebug.program.params.quiet=
  95. tools.mspdebug.program.params.noverify=
  96. tools.mspdebug.program.pattern={cmd.path} {program.verbose} {protocol} --force-reset "prog {build.path}/{build.project_name}.hex"

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:
  1. /*
  2.   ************************************************************************
  3.   *        pins_energia.h
  4.   *
  5.   *        Pin definition functions for LaunchPad w/ msp430f5438a
  6.   *                Copyright (c) 2015 Robert Wessels. All right reserved.
  7.   *
  8.   *     Contribution: Stefan Sch
  9.   *
  10.   ***********************************************************************
  11.   Derived from:
  12.   pins_arduino.h - Pin definition functions for Arduino
  13.   Part of Arduino - http://www.arduino.cc/
  14.   Copyright (c) 2007 David A. Mellis
  15.   This library is free software; you can redistribute it and/or
  16.   modify it under the terms of the GNU Lesser General Public
  17.   License as published by the Free Software Foundation; either
  18.   version 2.1 of the License, or (at your option) any later version.
  19.   This library is distributed in the hope that it will be useful,
  20.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.   Lesser General Public License for more details.
  23.   You should have received a copy of the GNU Lesser General
  24.   Public License along with this library; if not, write to the
  25.   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  26.   Boston, MA  02111-1307  USA
  27. */
  28. /*  
  29.   for MSP430F5438A  by huawei<huaweiwx@sina.com> 2016.8.20
  30. */
  31. #ifndef Pins_Energia_h
  32. #define Pins_Energia_h
  33. #ifndef BV
  34. #define BV(x) (1 << (x))
  35. #endif
  36. //all pins
  37. enum {
  38. P1_0,P1_1,P1_2,P1_3,P1_4,P1_5,P1_6,P1_7,
  39. P2_0,P2_1,P2_2,P2_3,P2_4,P2_5,P2_6,P2_7,
  40. P3_0,P3_1,P3_2,P3_3,P3_4,P3_5,P3_6,P3_7,
  41. P4_0,P4_1,P4_2,P4_3,P4_4,P4_5,P4_6,P4_7,
  42. P5_0,P5_1,P5_2,P5_3,P5_4,P5_5,P5_6,P5_7,
  43. P6_0,P6_1,P6_2,P6_3,P6_4,P6_5,P6_6,P6_7,
  44. P7_0,P7_1,P7_2,P7_3,P7_4,P7_5,P7_6,P7_7,
  45. P8_0,P8_1,P8_2,P8_3,P8_4,P8_5,P8_6,P8_7,
  46. P9_0,P9_1,P9_2,P9_3,P9_4,P9_5,P9_6,P9_7,
  47. P10_0,P10_1,P10_2,P10_3,P10_4,P10_5,P10_6,P10_7,
  48. P11_0,P11_1,P11_2,
  49. PJ_0,PJ_1,PJ_2,PJ_3,
  50. };
  51. #define BOTTON  P2_7
  52. #define LED_BUILTIN8 P10_7
  53. #define LED_BUILTIN7 P10_6
  54. #define LED_BUILTIN6 P10_5
  55. #define LED_BUILTIN5 P10_4
  56. #define LED_BUILTIN4 P10_3
  57. #define LED_BUILTIN3 P10_2
  58. #define LED_BUILTIN2 P10_1
  59. #define LED_BUILTIN1 P10_0
  60. #define LED_BUILTIN P10_0
  61. #define TEMPSENSOR (128 + 10)
  62. //#if defined(__MSP430_HAS_USCI_B0__) && defined(__MSP430_HAS_USCI_B1__)
  63. static const uint8_t SS       = P3_0;   /* P3.0 */
  64. static const uint8_t SCK      = P3_3;   /* P3.3 */
  65. static const uint8_t MOSI     = P3_1;   /* P3.1 aka SIMO */
  66. static const uint8_t MISO     = P3_2;   /* P3.2 aka SOMI */
  67. static const uint8_t TWISDA0  = P3_1;  /* P3.1 UCB0 */
  68. static const uint8_t TWISCL0  = P3_2;  /* P3.3 UCB0 */
  69. //USCI_B1
  70. static const uint8_t SS1      = P3_6;   /* P3.6 */
  71. static const uint8_t SCK1     = P5_5;   /* P5.5 */
  72. static const uint8_t MOSI1    = P3_7;   /* P3.7 aka SIMO */
  73. static const uint8_t MISO1    = P5_4;   /* P5.4 aka SOMI */
  74. static const uint8_t TWISDA1  = P3_7;   /* P3.7   UCB1 */
  75. static const uint8_t TWISCL1  = P3_6;   /* P3.6   UCB1 */
  76. #define TWISDA0_SET_MODE (PORT_SELECTION0 | INPUT_PULLUP)
  77. #define TWISCL0_SET_MODE (PORT_SELECTION0 | INPUT_PULLUP)
  78. #define TWISDA1_SET_MODE (PORT_SELECTION1 | INPUT_PULLUP)
  79. #define TWISCL1_SET_MODE (PORT_SELECTION1 | INPUT_PULLUP)
  80. #define SPISCK_SET_MODE  (PORT_SELECTION0)
  81. #define SPIMOSI_SET_MODE (PORT_SELECTION0)
  82. #define SPIMISO_SET_MODE (PORT_SELECTION0)
  83. /* Define the default I2C settings */
  84. #define DEFAULT_I2C 1
  85. #define TWISDA TWISDA1
  86. #define TWISCL TWISCL1
  87. #define TWISDA_SET_MODE  TWISDA1_SET_MODE
  88. #define TWISCL_SET_MODE  TWISCL1_SET_MODE
  89. //#endif
  90. //#if defined(__MSP430_HAS_USCI_A0__) || defined(__MSP430_HAS_USCI_A1__)
  91. static const uint8_t DEBUG_UARTRXD = P3_5;     /* Receive  Data (RXD) at P3.5 */
  92. static const uint8_t DEBUG_UARTTXD = P3_4;     /* Transmit Data (TXD) at P3.4 */
  93. static const uint8_t AUX_UARTRXD =   P5_6;     /* Receive  Data (RXD) at P5.6 */
  94. static const uint8_t AUX_UARTTXD =   P5_7;     /* Transmit Data (TXD) at P5.7 */
  95. #define DEBUG_UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
  96. #define DEBUG_UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
  97. #define AUX_UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
  98. #define AUX_UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
  99. #define DEBUG_UART_MODULE_OFFSET 0x20
  100. #define AUX_UART_MODULE_OFFSET   0x00
  101. #define SERIAL1_AVAILABLE 1
  102. //#endif
  103. #if defined(__MSP430_HAS_USCI_B2__)|| defined(__MSP430_HAS_USCI_B3__)
  104. #endif
  105. #if defined(__MSP430_HAS_USCI_A2__)|| defined(__MSP430_HAS_USCI_A3__)
  106. #endif
  107. /* Analog pins */
  108. static const uint8_t A0  = P6_0;
  109. static const uint8_t A1  = P6_1;
  110. static const uint8_t A2  = P6_2;
  111. static const uint8_t A3  = P6_3;
  112. static const uint8_t A4  = P6_4;
  113. static const uint8_t A5  = P6_5;
  114. static const uint8_t A6  = P6_6;
  115. static const uint8_t A7  = P6_7;
  116. static const uint8_t A8  = P5_0;
  117. static const uint8_t A9  = P5_1;
  118. static const uint8_t A10 = 128+0x0a;  //A10 Temperature
  119. static const uint8_t A11 = 128+0x0b;  //A11 Built-In VMID
  120. static const uint8_t A12 = P7_4;
  121. static const uint8_t A13 = P7_5;
  122. static const uint8_t A14 = P7_6;
  123. static const uint8_t A15 = P7_7;
  124. /* Pin names based on the silkscreen */
  125. #ifdef ARDUINO_MAIN
  126. const uint16_t port_to_input[] = {
  127.         NOT_A_PORT,
  128.         (uint16_t) &P1IN,
  129.         (uint16_t) &P2IN,
  130.         (uint16_t) &P3IN,
  131.         (uint16_t) &P4IN,
  132.         (uint16_t) &P5IN,
  133.         (uint16_t) &P6IN,
  134.         (uint16_t) &P7IN,
  135.         (uint16_t) &P8IN,
  136.         (uint16_t) &P9IN,
  137.         (uint16_t) &P10IN,
  138.         (uint16_t) &P11IN,
  139.         (uint16_t) &PJIN,
  140. };
  141. const uint16_t port_to_output[] = {
  142.          NOT_A_PORT,
  143.         (uint16_t) &P1OUT,
  144.         (uint16_t) &P2OUT,
  145.         (uint16_t) &P3OUT,
  146.         (uint16_t) &P4OUT,
  147.         (uint16_t) &P5OUT,
  148.         (uint16_t) &P6OUT,
  149.         (uint16_t) &P7OUT,
  150.         (uint16_t) &P8OUT,
  151.         (uint16_t) &P9OUT,
  152.         (uint16_t) &P10OUT,
  153.         (uint16_t) &P11OUT,
  154.         (uint16_t) &PJOUT,
  155. };
  156. const uint16_t port_to_dir[] = {
  157.         NOT_A_PORT,
  158.         (uint16_t) &P1DIR,
  159.         (uint16_t) &P2DIR,
  160.         (uint16_t) &P3DIR,
  161.         (uint16_t) &P4DIR,
  162.         (uint16_t) &P5DIR,
  163.         (uint16_t) &P6DIR,
  164.         (uint16_t) &P7DIR,
  165.         (uint16_t) &P8DIR,
  166.         (uint16_t) &P9DIR,
  167.         (uint16_t) &P10DIR,
  168.         (uint16_t) &P11DIR,
  169.         (uint16_t) &PJDIR,
  170. };
  171. const uint16_t port_to_ren[] = {
  172.         NOT_A_PORT,
  173.         (uint16_t) &P1REN,
  174.         (uint16_t) &P2REN,
  175.         (uint16_t) &P3REN,
  176.         (uint16_t) &P4REN,
  177.         (uint16_t) &P5REN,
  178.         (uint16_t) &P6REN,
  179.         (uint16_t) &P7REN,
  180.         (uint16_t) &P8REN,
  181.         (uint16_t) &P9REN,
  182.         (uint16_t) &P11REN,
  183.         (uint16_t) &P10REN,
  184.         (uint16_t) &PJREN,
  185. };
  186. const uint16_t port_to_sel0[] = {  /* put this PxSEL register under the group of PxSEL0 */
  187.         NOT_A_PORT,
  188.         (uint16_t) &P1SEL,
  189.         (uint16_t) &P2SEL,
  190.         (uint16_t) &P3SEL,
  191.         (uint16_t) &P4SEL,
  192.         (uint16_t) &P5SEL,
  193.         (uint16_t) &P6SEL,
  194.         (uint16_t) &P7SEL,
  195.         (uint16_t) &P8SEL,
  196.         (uint16_t) &P9SEL,
  197.         (uint16_t) &P10SEL,
  198.         (uint16_t) &P11SEL,
  199.     NOT_A_PORT,
  200. };
  201. const uint8_t digital_pin_to_timer[] = {
  202.         T0A0,         /* 17 - P1.0 */
  203.         T0A1,         /* 18 - P1.1 */
  204.         T0A2,         /* 19 - P1.2 */
  205.         T0A3,         /* 20 - P1.3 */
  206.         T0A4, /* 21 - P1.4  - note: CCR0 output cannot be used with analogWrite */
  207.         NOT_ON_TIMER, /* 22 - P1.5  - note: CCR0 output cannot be used with analogWrite */
  208.         NOT_ON_TIMER, /* 23 - P1.6 */ //T0A1_SEL01,  
  209.         NOT_ON_TIMER, /* 24 - P1.7 */ //T0A2_SEL01,  
  210.         
  211.         T1A0,                  /* 25 - P2.0 */        //T1B6_SEL1,  
  212.         T1A1,         /* 26 - P2.1 */    //T0B5_SEL1,
  213.         T1A2,         /* 27 - P2.2 */    //T0B4_SEL1,  
  214.         NOT_ON_TIMER, /* 28 - P2.3 */
  215.         NOT_ON_TIMER, /* 29 - P2.4 */
  216.         NOT_ON_TIMER, /* 30 - P2.5 */
  217.         NOT_ON_TIMER, /* 31 - P2.6 */
  218.         NOT_ON_TIMER, /* 32 - P2.7 */
  219.         
  220.         NOT_ON_TIMER, /* 33 - P3.0 */
  221.         NOT_ON_TIMER, /* 34 - P3.1 */
  222.         NOT_ON_TIMER, /* 35 - P3.2 */
  223.         NOT_ON_TIMER, /* 36 - P3.3 */
  224.             /* 39 - P3.4 */
  225.         NOT_ON_TIMER, /* 40 - P3.5 */
  226.         NOT_ON_TIMER, /* 41 - P3.6 */
  227.         NOT_ON_TIMER, /* 42 - P3.7 */
  228.         T0B0,         /* 43 - P4.0 */
  229.         T0B1,         /* 44 - P4.1 */
  230.         T0B2,         /* 45 - P4.2 */
  231.         T0B3,         /* 46 - P4.3 */
  232.         T0B4,         /* 47 - P4.4 */
  233.         T0B5,         /* 48 - P4.5 */
  234.         NOT_ON_TIMER, /* 49 - P4.6 */
  235.         NOT_ON_TIMER, /* 50 - P4.7 */
  236.         
  237.         NOT_ON_TIMER, /* 9  - P5.0 */
  238.         NOT_ON_TIMER, /* 10 - P5.1 */
  239.         NOT_ON_TIMER, /* 89 - P5.2 */
  240.         NOT_ON_TIMER, /* 90 - P5.3 */
  241.         NOT_ON_TIMER, /* 51 - P5.4 */
  242.         NOT_ON_TIMER, /* 52 - P5.5 */
  243.         NOT_ON_TIMER, /* 53 - P5.6 */
  244.         NOT_ON_TIMER, /* 54 - P5.7 */
  245.         NOT_ON_TIMER, /* 97 - P6.0 */
  246.         NOT_ON_TIMER, /* 98 - P6.1 */
  247.         NOT_ON_TIMER, /* 99 - P6.2 */
  248.         NOT_ON_TIMER, /* 100 - P6.3 */
  249.         NOT_ON_TIMER, /* 1 - P6.4 */
  250.         NOT_ON_TIMER, /* 2 - P6.5 */
  251.         NOT_ON_TIMER, /* 3 - P6.6 */
  252.         NOT_ON_TIMER,/* 4 - P6.7 */
  253.         
  254.         NOT_ON_TIMER,/* 13 - P7.0 XIN*/
  255.         NOT_ON_TIMER,/* 14 - P7.1 XOUT*/
  256.         NOT_ON_TIMER,/* 55 - P7.2 */
  257.         T1A2_SEL01                ,/* 56 - P7.3 */
  258.         NOT_ON_TIMER,/* 5 - P7.4 */
  259.         NOT_ON_TIMER,/* 6 - P7.5 */
  260.         NOT_ON_TIMER,/* 7 - P7.6 */
  261.         NOT_ON_TIMER,/* 8 - P7.7 */
  262.         
  263.         T0A0_SEL01,  /* 57 - P8.0 */        
  264.         T0A1_SEL01,  /* 58 - P8.1 */
  265.         T0A2_SEL01,  /* 59 - P8.2 */
  266.         T0A3_SEL01,  /* 60 - P8.3 */
  267.         T0A4_SEL01,  /* 61 - P8.4 */        
  268.         T1A0_SEL01                ,/* 65 - P8.5 */
  269.         T1A1_SEL01                ,/* 66 - P8.6 */
  270.         NOT_ON_TIMER, /* 67 - P8.7 */
  271.         
  272.         NOT_ON_TIMER, /* 68 - P9.0 */
  273.         NOT_ON_TIMER, /* 69 - P9.1 */
  274.         NOT_ON_TIMER, /* 70 - P9.2 */
  275.         NOT_ON_TIMER, /* 71 - P9.3 */
  276.         NOT_ON_TIMER, /* 72 - P9.4 */
  277.         NOT_ON_TIMER, /* 73 - P9.5 */
  278.         NOT_ON_TIMER, /* 73 - P9.6 */
  279.         NOT_ON_TIMER, /* 75 - P9.7 */
  280.         
  281.         NOT_ON_TIMER, /* 76 - P10.0 */
  282.         NOT_ON_TIMER, /* 77 - P10.1 */
  283.         NOT_ON_TIMER, /* 78 - P10.2 */
  284.         NOT_ON_TIMER, /* 79 - P10.3 */
  285.         NOT_ON_TIMER, /* 80 - P10.4 */
  286.         NOT_ON_TIMER, /* 81 - P10.5 */
  287.         NOT_ON_TIMER, /* 82 - P10.6 */
  288.         NOT_ON_TIMER, /* 83 - P10.7 */
  289.         
  290.         NOT_ON_TIMER, /* 84 - P11.0 */
  291.         NOT_ON_TIMER, /* 85 - P11.1 */
  292.         NOT_ON_TIMER, /* 86 - P11.2 */
  293.         
  294.         NOT_ON_TIMER, /* 92 - PJ.0 */
  295.         NOT_ON_TIMER, /* 93 - PJ.1 */
  296.         NOT_ON_TIMER, /* 94 - PJ.2 */
  297.         NOT_ON_TIMER, /* 95 - PJ.3 */
  298. };
  299. const uint8_t digital_pin_to_port[] = {
  300.         P1,        /* 17 - P1.0 */
  301.         P1,        /* 18 - P1.1 */
  302.         P1,        /* 19 - P1.2 */
  303.         P1,        /* 20 - P1.3 */
  304.         P1,        /* 21  - P1.4 */
  305.         P1,        /* 22 - P1.5 */
  306.         P1,        /* 23 - P1.6 */
  307.         P1,        /* 24 - P1.7 */
  308.         
  309.         P2,        /* 25  - P2.0 */
  310.         P2,        /* 26 - P2.1 */
  311.         P2,        /* 27 - P2.2 */
  312.         P2,        /* 28 - P2.3 */
  313.         P2,        /* 29 - P2.4 */
  314.         P2,        /* 30 - P2.5 */
  315.         P2,        /* 31 - P2.6 */
  316.         P2,        /* 32 - P2.7 */
  317.         
  318.         P3,        /* 33 - P3.0 */
  319.         P3,        /* 34 - P3.1 */
  320.         P3,        /* 35  - P3.2 */
  321.         P3,        /* 36 - P3.3 */
  322.         P3,        /* 39 - P3.4 */
  323.         P3,        /* 40 - P3.5 */
  324.         P3,        /* 41 - P3.6 */
  325.         P3,        /* 42 - P3.7 */
  326.         
  327.         P4,        /* 43 - P4.0 */
  328.         P4,        /* 44 - P4.1 */
  329.         P4,        /* 45 - P4.2 */
  330.         P4,        /* 46 - P4.3 */
  331.         P4,        /* 47 - P4.4 */
  332.         P4,        /* 48 - P4.5 */
  333.         P4,        /* 49 - P4.6 */
  334.         P4,        /* 50 - P4.7 */
  335.         
  336.         P5,        /* 9  - P5.0 */
  337.         P5,        /* 10 - P5.1 */
  338.         P5,        /* 89 - P5.2 */
  339.         P5,        /* 90 - P5.3 */
  340.         P5,        /* 51 - P5.4 */
  341.         P5,        /* 52 - P5.5 */
  342.         P5,        /* 53 - P5.6 */
  343.         P5,        /* 54 - P5.7 */
  344.         P6,         /* 97 - P6.0 */
  345.         P6,         /* 98 - P6.1 */
  346.         P6,         /* 99 - P6.2 */
  347.         P6,         /* 100 - P6.3 */
  348.         P6,         /* 1 - P6.4 */
  349.         P6,         /* 2 - P6.5 */
  350.         P6,         /* 3 - P6.6 */
  351.         P6,         /* 4 - P6.7 */
  352.         
  353.         P7,                        /* 13 - P7.0 XIN*/
  354.         P7,                        /* 14 - P7.1 XOUT*/
  355.         P7,                        /* 55 - P7.2 */
  356.         P7,                        /* 56 - P7.3 */
  357.         P7,                        /* 5 - P7.4 */
  358.         P7,                        /* 6 - P7.5 */
  359.         P7,                        /* 7 - P7.6 */
  360.         P7,                        /* 8 - P7.7 */
  361.         P8,        /* 57 - P8.0 */        
  362.         P8,        /* 58 - P8.1 */
  363.         P8,        /* 59 - P8.2 */
  364.         P8,        /* 60 - P8.3 */
  365.         P8,        /* 61 - P8.4 */
  366.         P8,        /* 65 - P8.5 */
  367.         P8,        /* 66 - P8.6 */
  368.         P8,        /* 67 - P8.7 */
  369.         
  370.         P9,        /* 68 - P9.0 */
  371.         P9,        /* 69 - P9.1 */
  372.         P9,        /* 70 - P9.2 */
  373.         P9,        /* 71 - P9.3 */
  374.         P9,        /* 72 - P9.4 */
  375.         P9,        /* 73 - P9.5 */
  376.         P9,        /* 73 - P9.6 */
  377.         P9,        /* 75 - P9.7 */
  378.         
  379.         P10,        /* 76 - P10.0 */
  380.         P10,        /* 77 - P10.1 */
  381.         P10,        /* 78 - P10.2 */
  382.         P10,        /* 79 - P10.3 */
  383.         P10,        /* 80 - P10.4 */
  384.         P10,        /* 81 - P10.5 */
  385.         P10,        /* 82 - P10.6 */
  386.         P10,        /* 83 - P10.7 */
  387.         
  388.         P11,        /* 84 - P11.0 */
  389.         P11,        /* 85 - P11.1 */
  390.         P11,        /* 86 - P11.2 */
  391.         
  392.         PJ,         /* 92 - PJ.0 */
  393.         PJ,         /* 93 - PJ.1 */
  394.         PJ,         /* 94 - PJ.2 */
  395.         PJ,         /* 95 - PJ.3 */
  396. };
  397. const uint8_t digital_pin_to_bit_mask[] = {
  398.         BV(0),     /* 17 - P1.0 */
  399.         BV(1),     /* 18 - P1.1 */
  400.         BV(2),     /* 19 - P1.2 */
  401.         BV(3),     /* 20 - P1.3 */
  402.         BV(4),     /* 21 - P1.4 */
  403.         BV(5),     /* 22 - P1.5 */
  404.         BV(6),     /* 23 - P1.6 */
  405.         BV(7),     /* 24 - P1.7 */
  406.         
  407.         BV(0),     /* 25 - P2.0 */
  408.         BV(1),     /* 26 - P2.1 */
  409.         BV(2),     /* 27 - P2.2 */
  410.         BV(3),     /* 28 - P2.3 */
  411.         BV(4),     /* 29 - P2.4 */
  412.         BV(5),     /* 30 - P2.5 */
  413.         BV(6),     /* 31 - P2.6 */
  414.         BV(7),     /* 32 - P2.7 */
  415.         
  416.         BV(0),     /* 33 - P3.0 */
  417.         BV(1),     /* 34 - P3.1 */
  418.         BV(2),     /* 35 - P3.2 */
  419.         BV(3),     /* 36 - P3.3 */
  420.         BV(4),     /* 39 - P3.4 */
  421.         BV(5),     /* 40 - P3.5 */
  422.         BV(6),     /* 41 - P3.6 */
  423.         BV(7),     /* 42 - P3.7 */
  424.         
  425.         BV(0),     /* 43 - P4.0 */
  426.         BV(1),     /* 44 - P4.1 */
  427.         BV(2),     /* 45 - P4.2 */
  428.         BV(3),     /* 46 - P4.3 */
  429.         BV(4),     /* 47 - P4.4 */
  430.         BV(5),     /* 48 - P4.5 */
  431.         BV(6),     /* 49 - P4.6 */                
  432.         BV(7),     /* 50 - P4.7 */
  433.         
  434.         BV(0),     /* 9  - P5.0 */
  435.         BV(1),     /* 10 - P5.1 */
  436.         BV(2),     /* 89 - P5.2 */
  437.         BV(3),     /* 90 - P5.3 */
  438.         BV(4),     /* 51 - P5.4 */
  439.         BV(5),     /* 52 - P5.5 */
  440.         BV(6),     /* 53 - P5.6 */
  441.         BV(7),     /* 54 - P5.7 */
  442.         
  443.         BV(0),         /* 97 - P6.0 */
  444.         BV(1),         /* 98 - P6.1 */
  445.         BV(2),         /* 99 - P6.2 */
  446.         BV(3),         /* 100 - P6.3 */
  447.         BV(4),         /* 1 - P6.4 */
  448.         BV(5),         /* 2 - P6.5 */
  449.         BV(6),         /* 3 - P6.6 */
  450.         BV(7),         /* 4 - P6.7 */
  451.         
  452.         BV(0),                        /* 13 - P7.0 XIN*/
  453.         BV(1),                        /* 14 - P7.1 XOUT*/
  454.         BV(2),                        /* 55 - P7.2 */
  455.         BV(3),                        /* 56 - P7.3 */
  456.         BV(4),                        /* 5 - P7.4 */
  457.         BV(5),                        /* 6 - P7.5 */
  458.         BV(6),                        /* 7 - P7.6 */
  459.         BV(7),                        /* 8 - P7.7 */
  460.         
  461.         BV(0),     /* 57 - P8.0 */        
  462.         BV(1),     /* 58 - P8.1 */
  463.         BV(2),     /* 59 - P8.2 */
  464.         BV(3),     /* 60 - P8.3 */
  465.         BV(4),     /* 61 - P8.4 */
  466.         BV(5),     /* 65 - P8.5 */
  467.         BV(6),     /* 66 - P8.6 */
  468.         BV(7),     /* 67 - P8.7 */
  469.         
  470.         BV(0),     /* 68 - P9.0 */
  471.         BV(1),     /* 69 - P9.1 */
  472.         BV(2),     /* 70 - P9.2 */
  473.         BV(3),     /* 71 - P9.3 */
  474.         BV(4),     /* 72 - P9.4 */
  475.         BV(5),     /* 73 - P9.5 */
  476.         BV(6),     /* 74 - P9.6 */
  477.         BV(7),     /* 75 - P9.7 */
  478.         
  479.         BV(0),     /* 76 - P10.0 */
  480.         BV(1),     /* 77 - P10.1 */
  481.         BV(2),     /* 78 - P10.2 */
  482.         BV(3),     /* 79 - P10.3 */
  483.         BV(4),     /* 80 - P10.4 */
  484.         BV(5),     /* 81 - P10.5 */
  485.         BV(6),     /* 82 - P10.6 */
  486.         BV(7),     /* 83 - P10.7 */
  487.         
  488.         BV(0),     /* 84 - P11.0 */
  489.         BV(1),     /* 85 - P11.1 */
  490.         BV(2),     /* 86 - P11.2 */
  491.         
  492.         BV(0),     /* 92 - PJ.0 */
  493.         BV(1),     /* 93 - PJ.1 */
  494.         BV(2),     /* 94 - PJ.2 */
  495.         BV(3),     /* 95 - PJ.3 */
  496. };
  497. const uint32_t digital_pin_to_analog_in[] = {
  498.         NOT_ON_ADC,     /*  17 - P1.0 */
  499.         NOT_ON_ADC,     /*  18 - P1.1 */
  500.         NOT_ON_ADC,     /*  19 - P1.2 */
  501.                 NOT_ON_ADC,     /*  20 - P1.3 */
  502.         NOT_ON_ADC,         /*  21 - P1.4 */
  503.         NOT_ON_ADC,     /*  22 - P1.5 */
  504.         NOT_ON_ADC,         /*  23 - P1.6 */
  505.         NOT_ON_ADC,     /*  24 - P1.7 */
  506.                 
  507.         NOT_ON_ADC,         /*  25 - P2.0 */
  508.         NOT_ON_ADC,         /*  26 - P2.1 */
  509.         NOT_ON_ADC,     /*  27 - P2.2 */
  510.         NOT_ON_ADC,     /*  28 - P2.3 */
  511.         NOT_ON_ADC,         /*  29 - P2.4 */
  512.         NOT_ON_ADC,     /*  30 - P2.5 */
  513.         NOT_ON_ADC,     /*  31 - P2.6 */
  514.         NOT_ON_ADC,     /*  32 - P2.7 */
  515.                 
  516.         NOT_ON_ADC,     /*  33 - P3.0 */
  517.         NOT_ON_ADC,     /*  34 - P3.1 */
  518.         NOT_ON_ADC,                /*  35 - P3.2 */
  519.         NOT_ON_ADC,                /*  36 - P3.3 */
  520.         NOT_ON_ADC,     /*  39 - P3.4 */
  521.         NOT_ON_ADC,     /*  40 - P3.5 */
  522.         NOT_ON_ADC,          /*  41 - P3.6 */
  523.         NOT_ON_ADC,     /*  42 - P3.7 */
  524.                 
  525.         NOT_ON_ADC,         /*  43 - P4.0 */
  526.         NOT_ON_ADC,         /*  44 - P4.1 */
  527.         NOT_ON_ADC,         /*  45 - P4.2 */
  528.         NOT_ON_ADC,         /*  46 - P4.3 */
  529.         NOT_ON_ADC,         /*  47 - P4.4 */
  530.         NOT_ON_ADC,     /*  48 - P4.5 */
  531.         NOT_ON_ADC,     /*  49 - P4.6 */        
  532.         NOT_ON_ADC,         /*  50 - P4.7 */
  533.                 
  534.         8,         /*  9  - P5.0 */
  535.         9,         /*  10 - P5.1 */
  536.         NOT_ON_ADC,         /*  89 - P5.2 */
  537.         NOT_ON_ADC,         /*  90 - P5.3 */                
  538.         NOT_ON_ADC,         /*  51 - P5.4 */
  539.         NOT_ON_ADC,         /*  52 - P5.5 */
  540.         NOT_ON_ADC,         /*  53 - P5.6 */
  541.         NOT_ON_ADC,         /*  54 - P5.7 */
  542.                 
  543.                 0,                            /* 97 - P6.0 */
  544.                 1,                      /* 98 - P6.1 */
  545.                 2,                             /* 99 - P6.2 */
  546.                 3,                             /* 100 - P6.3 */
  547.                 4,                       /* 1 - P6.4 */
  548.                 5,                       /* 2 - P6.5 */
  549.                 6,                       /* 3 - P6.6 */
  550.                 7,                       /* 4 - P6.7 */
  551.                 
  552.                 NOT_ON_ADC,      /* 13 - P7.0 XIN*/
  553.                 NOT_ON_ADC,      /* 14 - P7.1 XOUT*/
  554.                 NOT_ON_ADC,      /* 55 - P7.2 */
  555.                 NOT_ON_ADC,      /* 56 - P7.3 */
  556.                 12,      /* 5 - P7.4 */
  557.                 13,      /* 6 - P7.5 */
  558.                 14,      /* 7 - P7.6 */
  559.                 15,      /* 8 - P7.7 */
  560.                 
  561.                 NOT_ON_ADC,       /* 57 - P8.0 */        
  562.                 NOT_ON_ADC,       /* 58 - P8.1 */
  563.                 NOT_ON_ADC,      /* 59 - P8.2 */
  564.                 NOT_ON_ADC,      /* 60 - P8.3 */
  565.         NOT_ON_ADC,                /*  61 - P8.4 */
  566.                 NOT_ON_ADC,      /*  65 - P8.5 */
  567.                 NOT_ON_ADC,      /*  66 - P8.6 */
  568.                 NOT_ON_ADC,      /*  67 - P8.7 */
  569.                 
  570.                 NOT_ON_ADC,      /*  68 - P9.0 */
  571.                 NOT_ON_ADC,      /*  69 - P9.1 */
  572.                 NOT_ON_ADC,      /*  70 - P9.2 */
  573.                 NOT_ON_ADC,      /*  71 - P9.3 */
  574.                 NOT_ON_ADC,      /*  72 - P9.4 */
  575.                 NOT_ON_ADC,      /*  73 - P9.5 */
  576.                 NOT_ON_ADC,      /*  74 - P9.6 */
  577.                 NOT_ON_ADC,      /*  75 - P9.7 */
  578.                 
  579.                 NOT_ON_ADC,     /* 76 - P10.0 */
  580.                 NOT_ON_ADC,     /* 77 - P10.1 */
  581.                 NOT_ON_ADC,     /* 78 - P10.2 */
  582.                 NOT_ON_ADC,     /* 79 - P10.3 */
  583.                 NOT_ON_ADC,     /* 80 - P10.4 */
  584.                 NOT_ON_ADC,     /* 81 - P10.5 */
  585.                 NOT_ON_ADC,     /* 82 - P10.6 */
  586.                 NOT_ON_ADC,     /* 83 - P10.7 */
  587.                 
  588.                 NOT_ON_ADC,     /* 84 - P11.0 */
  589.                 NOT_ON_ADC,     /* 85 - P11.1 */
  590.                 NOT_ON_ADC,     /* 86 - P11.2 */
  591.                 
  592.         NOT_ON_ADC,         /* 92 - PJ.0 */
  593.         NOT_ON_ADC,         /* 93 - PJ.1 */
  594.         NOT_ON_ADC,     /* 94 - PJ.2 */
  595.         NOT_ON_ADC,     /* 95 - PJ.3 */
  596. };
  597. #endif // #ifdef ARDUINO_MAIN
  598. #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 部分就不在这里介绍了,因为用的坛友很少,如有这方面板子的并感兴趣,直接向我索取。
本文内容包含图片或附件,获取更多资讯,请 登录 后查看;或者 注册 成为会员获得更多权限
本帖最近打赏记录:共7条打赏 ,M币+21
离线jpdd521

发帖
25694
M币
7956
专家
15
粉丝
350
只看该作者 1楼 发表于: 2016-08-29
请登录后查看
离线jpdd521

发帖
25694
M币
7956
专家
15
粉丝
350
只看该作者 2楼 发表于: 2016-08-29
请登录后查看
本帖最近打赏记录:共1条打赏 ,M币+3
离线xktx09

发帖
4992
M币
3889
专家
2
粉丝
126
只看该作者 3楼 发表于: 2016-08-29
请登录后查看
本帖最近打赏记录:共1条打赏 ,M币+3
离线winwin8691

发帖
10
M币
-9
专家
0
粉丝
2
只看该作者 4楼 发表于: 2016-08-29
请登录后查看
本帖最近打赏记录:共1条打赏 ,M币+3
离线yofa2008

发帖
554
M币
43
专家
3
粉丝
27
只看该作者 5楼 发表于: 2016-08-29
请登录后查看
本帖最近打赏记录:共1条打赏 ,M币+3
离线huaweiwx

发帖
1372
M币
2167
专家
65
粉丝
297
只看该作者 6楼 发表于: 2016-08-29
回 jpdd521 的帖子
请登录后查看
离线huaweiwx

发帖
1372
M币
2167
专家
65
粉丝
297
只看该作者 7楼 发表于: 2016-08-29
回 xktx09 的帖子
请登录后查看
离线huaweiwx

发帖
1372
M币
2167
专家
65
粉丝
297
只看该作者 8楼 发表于: 2016-08-29
请登录后查看
本帖最近打赏记录:共1条打赏 ,M币+3
离线jpdd521

发帖
25694
M币
7956
专家
15
粉丝
350
只看该作者 9楼 发表于: 2016-08-29
请登录后查看
快速回复
限80 字节
“新手上路”发帖需审核后才能显示(请认真发帖),达到数码9级后取消此限制
 
上一个 下一个