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.

[参考译文] MSP430FR4133:如何使用 HC-05蓝牙模块切换 LED

Guru**** 657930 points
Other Parts Discussed in Thread: MSP430FR4133, ENERGIA
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1077427/msp430fr4133-how-to-use-hc-05-bluetooth-module-to-toggle-led

部件号:MSP430FR4133
《线程: 能源》中讨论的其他部分

首先,我是这方面的完全新人,因此我对这一问题缺乏了解,因此我对此深表歉意。

我有一个 MSP430FR4133推出板修订版1.0和一个 HC-05蓝牙模块,我从必胜客网站 https://thepihut.com/products/hc-05-bluetooth-module 上获得了这些模块

蓝牙模块有以下针脚 Vcc,Ground,RXD TXD en 和 State -我知道 EN 和 State 不需要连接到主板

我已经尝试了很多小时来进行通信,方法是将 RXD 和 TXD 连接到 P1.1和 P1.0,以及 Energia 中的代码的多次迭代(这也是我对这一点的新了解)

我可以通过 MSP 打开 HC-05模块的电源,甚至可以通过计算机蓝牙连接。 在 Energia,我甚至可以选择用于串行监视器的 HC-05端口。

实际上,我要做的是连接 HC-05,这样我就可以通过串行监视器发送1,这将打开红色 LED,0将关闭 LED。

如果我的连接将相同的针脚连接到 HC-05,我如何在 Energia 中对其进行编码以使其正常工作。 我了解 Energia 代码与 Arduino 的距离非常近,因此我们非常感谢您的任何帮助

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您是否正在与模块通信? 如果您发送命令以获取其状态,它是否回复?

    您已连接到模块的针脚是什么? 您希望 MSP 的 TXD 与 HC05的 RXD 对应,反之亦然。 确保您具有正确的初始波特率

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我尝试通过 Energia 与 HC-05上的端口与模块通信,但我没有得到任何响应。 我可以通过命令行(如 MAC 地址和上次访问日期)访问一些有关它的信息,但不确定如何获得它的状态。

    连接如下:

    蓝牙模块- MSP430FR4133:

    VCC - 3V3  

    接地—接地

    RxD - TXD

    TxD - RXD

    下面是我为 MSP 编译的代码:

    #define LED RED_LED

    #include <SoftwareSerial.h>

    SoftwareSerial BTserial(3,4);

    void setup() {
    Serial.begin(9600);
    BTserial.begin(9600);
    }

    void loop() {
    if (BTserial.available())
    {
    byte x = BTserial.read();
    if(x == '1'){
    digitalWrite(LED, HIGH);
    }
    Serial.write(x);
    BTserial.write(x);
    }

    if (Serial.available())
    {
    byte y = Serial.read();
    if(y == '2'){
    digitalWrite(LED, LOW);
    }
    BTserial.write(y);
    Serial.write(y);
    }
    }

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    跑步前走一走。 查看 HC-05数据表。 找到命令,让设备返回一些信息。 使用 BTSerial.Write 发送该命令。 当序列可用时显示数据已到达,请将该数据复制到序列。

    如果这样做奏效,您就知道自己已经建立了沟通。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    再次感谢 Keith 的帮助。 因此,我尝试像您所说的那样使用蓝牙命令进行通信,只需发送一个简单的 AT,就可以实现响应“正常”的目标。 这一答复从未收到。

    我在 HC-05 https://youtu.be/BXXAcFOTnBo 上找到了有关如何与命令通信的视频

    这让我意识到我的 Energia (非 windows)没有 Windows 版本所使用的 COM 串行端口,这可能是我的问题。

    我将获得 Windows 版本的版本并尝试此通信,并将告诉您它的进展情况

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    如果您在 Mac 上,只需查找正在使用的串行端口。 它应该为您列出这些选项,您通常有2个选项。 我总是先猜错了。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    应返回 OK 的命令位于。 我有两个蓝牙端口可供选择,两个 USB 端口可供选择。 端口是

    HC-05 -您可能怀疑这是这种情况,但很遗憾,发送 AT 时没有返回任何内容

    蓝牙输入端口-与上述端口相同  

    USB 调制解调器12401 -当出现 AT 时,这种调制解调器确实会返回一些内容,但它是一堆[]? 符号-我已尝试所有波特率,但没有任何更改。

    USBModem 12403 -未返回任何内容。

    我已按照所述将 RX 和 TX 连接到引脚1.1和1.0,因此尝试将我对 BTSerial 的定义更改为引脚3.4或1.0,1.1或23,24或7,8,但它们都不起作用。

    唯一有希望的迹象是,当我将设备连接到 HC-05时,当光线从快速闪烁切换到较长的间隙时,我收到了视觉确认。

    我想知道我在这里有没有比这更好的东西了,因为我不知道如何与它沟通。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    让我们再次回到这里。 忘记蓝牙一秒钟。 我们只是想让 MCU 进行通信。

    首先移除 HC-05,运行 Arduino Hello world 计划:

    https://arduinogetstarted.com/tutorials/arduino-hello-world

    接下来,挂接 HC-05并获取 AT 命令,在控制台上执行“确定”打印操作。

    现在请担心蓝牙。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    好的,再次感谢——我得到了世界的问候,并向控制台提出了问题。  

    我已经连接了 HC-05。  

    我尝试通过代码向发送命令,例如 BTSerial.println("at");

    我尝试使用串行监视器输入框发送命令-无响应。

    我怀疑我没有正确设置 HC-05 SoftwareSerial 或某些内容。  

    我是否按照所述与 RX/TX 引脚连接-制作软件串行时是否选择了错误的引脚?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我不知道,我在几年前就放弃了 Energia。 我找不到您的主板的主板信息。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    好的,再次感谢你们的帮助。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您是否有可用的范围?

    您是否有板参数链接?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    不幸的是,我无法访问范围。

    很抱歉,不确定哪些主板参数是什么-如果这是您的意思,我有这个主板特定文件,称为“Energia 中的 PINS”

    /*
      ************************************************************************
      *	pins_energia.h
      *
      *	Pin definition functions for LaunchPad w/ msp430fr4133
      *		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
    */
    
    
    #ifndef Pins_Energia_h
    #define Pins_Energia_h
    #ifndef BV
    #define BV(x) (1 << (x))
    #endif
    
    #include <msp430fr2xx_4xxgeneric.h>
    
    // Attribute for placing R/W variables in FRAM
    // Example
    //      uint8_t DisplayBuffer[LCD_MAXIMUM_Y][LCD_MAXIMUM_X] PLACE_IN_FRAM;
    #define PLACE_IN_FRAM __attribute__((section(".text;")))
    
    
    #if defined(__MSP430_HAS_EUSCI_B0__)
    static const uint8_t SS      = 8;   /* P2.5 */
    static const uint8_t SCK     = 7;   /* P5.1 */
    static const uint8_t MOSI    = 15;  /* P5.2 aka SIMO */
    static const uint8_t MISO    = 14;  /* P5.3 aka SOMI */
    static const uint8_t TWISCL1  = 9;   /* P8.2 SW I2C */
    static const uint8_t TWISDA1  = 10;  /* P8.3 SW I2C */
    static const uint8_t TWISDA0  = 15;  /* P5.2 UCB0 */
    static const uint8_t TWISCL0  = 14;  /* P5.3 UCB0 */
    #define TWISDA0_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
    #define TWISCL0_SET_MODE  (PORT_SELECTION0 | INPUT_PULLUP)
    #define TWISDA1_SET_MODE  (INPUT_PULLUP)
    #define TWISCL1_SET_MODE  (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 /* indicates SW I2C on pseudo module 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_EUSCI_A0__) || defined(__MSP430_HAS_EUSCI_A1__)
    static const uint8_t DEBUG_UARTRXD = 3;  /* Receive  Data (RXD) at P1.1 */
    static const uint8_t DEBUG_UARTTXD = 4;  /* Transmit Data (TXD) at P1.0 */
    #define DEBUG_UARTRXD_SET_MODE (PORT_SELECTION0 | INPUT)
    #define DEBUG_UARTTXD_SET_MODE (PORT_SELECTION0 | OUTPUT)
    #define DEBUG_UART_MODULE_OFFSET 0x00
    #endif
    
    /* Enable P4.1/2 as XTAL pins = FR4133 */
    #define INIT_LFXTAL_PINS 	P4SEL0 = BIT1 | BIT2
    #define F_CPU  16000000L
    
    
    /* Analog pins */
    static const uint8_t A0  = 4;
    static const uint8_t A1  = 3;
    static const uint8_t A2  = 128 + 2;  // Not available on BoosterPack header
    static const uint8_t A3  = 13;
    static const uint8_t A4  = 12;
    static const uint8_t A5  = 11;
    static const uint8_t A6  = 18;
    static const uint8_t A7  = 19;
    static const uint8_t A8  = 6;
    static const uint8_t A9  = 2;
    static const uint8_t A10 = 128 + 10; // Not available on BoosterPack header
    static const uint8_t A11 = 128 + 11; // Not available on BoosterPack header
    static const uint8_t A12 = 128 + 12; // Not available on BoosterPack header
    static const uint8_t A13 = 128 + 13; // Not available on BoosterPack header
    static const uint8_t A14 = 128 + 14; // Not available on BoosterPack header
    static const uint8_t A15 = 128 + 15; // Not available on BoosterPack header
    
    //-------------------------------------------
    
    /* Layout of the 2 - 10 pin headers.
    
       All pins support digitalWrite() and attachInterrupt()
       Pins marked with PWM support anaglogWrite()
       Pins marked with Ax support analogRead()
    
                                              +---\/---+
                                       VCC0  1|        |20  GND
                                (A9)   P8.1  2|        |19  P1.7            (A7) (PWM)
          (UCA0RXD -> Serial0)  (A1)   P1.1  3|        |18  P1.6            (A6) (PWM)
          (UCA0TXD -> Serial0)  (A0)   P1.0  4|        |17  P5.0
                                       P2.7  5|        |16  RST
                                (A8)   P8.0  6|        |15  P5.2 (SDA) (MOSI)
                        (SCK)          P5.1  7|        |14  P5.3 (SCL) (MISO)
                                       P2.5  8|        |13  P1.3            (A3) 
                                       P8.2  9|        |12  P1.4            (A4) 
                        (PWM)          P8.3 10|        |11  P1.5            (A5) 
                                              +--------+
    
    
                                                   ----+
                                                       |4   DebugUART TX  (P1.0) (A0)
                         J13 eZ-FET Connector          |3   DebugUART RX  (P1.1) (A1)
                                                       |21  DebugUART CTS (P2.4)
                                                       |22  DebugUART RTS (P2.3)
                                                   ----+
                                                   ----+
                                                       |4   LED1       (P1.0)    (A0)
                         Extra LED's and Switches      |23  LED2       (P4.0)   (PWM)
                                                       |24  PUSH1      (P1.2)    (A2)
                                                       |25  PUSH2      (P2.6)
                                                   ----+
    */
    
    // Pin names based on the silkscreen
    //
    
    static const uint8_t P1_0 = 4;
    static const uint8_t P1_1 = 3;
    static const uint8_t P1_2 = 24;
    static const uint8_t P1_3 = 13;
    static const uint8_t P1_4 = 12;
    static const uint8_t P1_5 = 11;
    static const uint8_t P1_6 = 18;
    static const uint8_t P1_7 = 19;
    
    //static const uint8_t P2_0 = ;
    //static const uint8_t P2_1 = ;
    //static const uint8_t P2_2 = ;
    static const uint8_t P2_3 = 22;
    static const uint8_t P2_4 = 21;
    static const uint8_t P2_5 = 8;
    static const uint8_t P2_6 = 25;
    static const uint8_t P2_7 = 5;
    
    //static const uint8_t P3_0 = ;
    //static const uint8_t P3_1 = ;
    //static const uint8_t P3_2 = ;
    //static const uint8_t P3_3 = ;
    //static const uint8_t P3_4 = ;
    //static const uint8_t P3_5 = ;
    //static const uint8_t P3_6 = ;
    //static const uint8_t P3_7 = ;
    
    static const uint8_t P4_0 = 23;
    //static const uint8_t P4_1 = ;
    //static const uint8_t P4_2 = ;
    //static const uint8_t P4_3 = ;
    //static const uint8_t P4_4 = ;
    //static const uint8_t P4_5 = ;
    //static const uint8_t P4_6 = ;
    //static const uint8_t P4_7 = ;
    
    static const uint8_t P5_0 = 17;
    static const uint8_t P5_1 = 7;
    static const uint8_t P5_2 = 15;
    static const uint8_t P5_3 = 14;
    //static const uint8_t P5_4 = ;
    //static const uint8_t P5_5 = ;
    //static const uint8_t P5_6 = ;
    //static const uint8_t P5_7 = ;
    
    static const uint8_t P8_0 = 6;
    static const uint8_t P8_1 = 2;
    static const uint8_t P8_2 = 9;
    static const uint8_t P8_3 = 10;
    //static const uint8_t P8_4 = ;
    //static const uint8_t P8_5 = ;
    //static const uint8_t P8_6 = ;
    //static const uint8_t P8_7 = ;
    
    //static const uint8_t PJ_0 = ;
    //static const uint8_t PJ_1 = ;
    //static const uint8_t PJ_2 = ;
    //static const uint8_t PJ_3 = ;
    //static const uint8_t PJ_4 = ;
    //static const uint8_t PJ_5 = ;
    //static const uint8_t PJ_6 = ;
    //static const uint8_t PJ_7 = ;
    
    
    static const uint8_t LED1 = 4;
    static const uint8_t LED2 = 23;
    /* For LaunchPad compatability */
    static const uint8_t RED_LED = 4;
    static const uint8_t GREEN_LED = 23;
    
    static const uint8_t PUSH1 = 24;
    static const uint8_t PUSH2 = 25;
    static const uint8_t TEMPSENSOR = 128 + 12; // depends on chip
    
    #ifdef ARDUINO_MAIN
    const uint16_t port_to_input[] = {
       NOT_A_PORT,
       (uint16_t) (P1_BASE+OFS_P1IN),
       (uint16_t) (P2_BASE+OFS_P2IN),
    #ifdef __MSP430_HAS_PORT3_R__
       (uint16_t) (P3_BASE+OFS_P3IN),
    #endif
    #ifdef __MSP430_HAS_PORT4_R__
       (uint16_t) (P4_BASE+OFS_P4IN),
    #endif
    #ifdef __MSP430_HAS_PORT5_R__
       (uint16_t) (P5_BASE+OFS_P5IN),
    #endif
    #ifdef __MSP430_HAS_PORT6_R__
       (uint16_t) (P6_BASE+OFS_P6IN),
    #endif
    #ifdef __MSP430_HAS_PORT7_R__
       (uint16_t) (P7_BASE+OFS_P7IN),
    #endif
    #ifdef __MSP430_HAS_PORT8_R__
       (uint16_t) (P8_BASE+OFS_P8IN),
    #endif
    #ifdef __MSP430_HAS_PORT9_R__
       (uint16_t) (P9_BASE+OFS_P9IN),
    #endif
    #ifdef __MSP430_HAS_PORT10_R__
       (uint16_t) (P10_BASE+OFS_P10IN),
    #endif
    #ifdef __MSP430_HAS_PORTJ_R__
       (uint16_t) (PJ_BASE+OFS_PJIN),
    #endif
    };
    
    const uint16_t port_to_output[] = {
       NOT_A_PORT,
       (uint16_t) (P1_BASE+OFS_P1OUT),
       (uint16_t) (P2_BASE+OFS_P2OUT),
    #ifdef __MSP430_HAS_PORT3_R__
       (uint16_t) (P3_BASE+OFS_P3OUT),
    #endif
    #ifdef __MSP430_HAS_PORT4_R__
       (uint16_t) (P4_BASE+OFS_P4OUT),
    #endif
    #ifdef __MSP430_HAS_PORT5_R__
       (uint16_t) (P5_BASE+OFS_P5OUT),
    #endif
    #ifdef __MSP430_HAS_PORT6_R__
       (uint16_t) (P6_BASE+OFS_P6OUT),
    #endif
    #ifdef __MSP430_HAS_PORT7_R__
       (uint16_t) (P7_BASE+OFS_P7OUT),
    #endif
    #ifdef __MSP430_HAS_PORT8_R__
       (uint16_t) (P8_BASE+OFS_P8OUT),
    #endif
    #ifdef __MSP430_HAS_PORT9_R__
       (uint16_t) (P9_BASE+OFS_P9OUT),
    #endif
    #ifdef __MSP430_HAS_PORT10_R__
       (uint16_t) (P10_BASE+OFS_P10OUT),
    #endif
    #ifdef __MSP430_HAS_PORTJ_R__
       (uint16_t) (PJ_BASE+OFS_PJOUT),
    #endif
    };
    
    const uint16_t port_to_dir[] = {
       NOT_A_PORT,
       (uint16_t) (P1_BASE+OFS_P1DIR),
       (uint16_t) (P2_BASE+OFS_P2DIR),
    #ifdef __MSP430_HAS_PORT3_R__
       (uint16_t) (P3_BASE+OFS_P3DIR),
    #endif
    #ifdef __MSP430_HAS_PORT4_R__
       (uint16_t) (P4_BASE+OFS_P4DIR),
    #endif
    #ifdef __MSP430_HAS_PORT5_R__
       (uint16_t) (P5_BASE+OFS_P5DIR),
    #endif
    #ifdef __MSP430_HAS_PORT6_R__
       (uint16_t) (P6_BASE+OFS_P6DIR),
    #endif
    #ifdef __MSP430_HAS_PORT7_R__
       (uint16_t) (P7_BASE+OFS_P7DIR),
    #endif
    #ifdef __MSP430_HAS_PORT8_R__
       (uint16_t) (P8_BASE+OFS_P8DIR),
    #endif
    #ifdef __MSP430_HAS_PORT9_R__
       (uint16_t) (P9_BASE+OFS_P9DIR),
    #endif
    #ifdef __MSP430_HAS_PORT10_R__
       (uint16_t) (P10_BASE+OFS_P10DIR),
    #endif
    #ifdef __MSP430_HAS_PORTJ_R__
       (uint16_t) (PJ_BASE+OFS_PJDIR),
    #endif
    };
    
    const uint16_t port_to_ren[] = {
    	   NOT_A_PORT,
    	   (uint16_t) (P1_BASE+OFS_P1REN),
    	   (uint16_t) (P2_BASE+OFS_P2REN),
    	#ifdef __MSP430_HAS_PORT3_R__
    	   (uint16_t) (P3_BASE+OFS_P3REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT4_R__
    	   (uint16_t) (P4_BASE+OFS_P4REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT5_R__
    	   (uint16_t) (P5_BASE+OFS_P5REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT6_R__
    	   (uint16_t) (P6_BASE+OFS_P6REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT7_R__
    	   (uint16_t) (P7_BASE+OFS_P7REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT8_R__
    	   (uint16_t) (P8_BASE+OFS_P8REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT9_R__
    	   (uint16_t) (P9_BASE+OFS_P9REN),
    	#endif
    	#ifdef __MSP430_HAS_PORT10_R__
    	   (uint16_t) (P10_BASE+OFS_P10REN),
    	#endif
    	#ifdef __MSP430_HAS_PORTJ_R__
    	   (uint16_t) (PJ_BASE+OFS_PJREN),
    	#endif
    };
    
    const uint16_t port_to_sel0[] = {  /* put this PxSEL register under the group of PxSEL0 */
    	   NOT_A_PORT,
    	   (uint16_t) (P1_BASE+OFS_P1SEL0),
    	   (uint16_t) (P2_BASE+OFS_P2SEL0),
    	#ifdef __MSP430_HAS_PORT3_R__
    	   (uint16_t) (P3_BASE+OFS_P3SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT4_R__
    	   (uint16_t) (P4_BASE+OFS_P4SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT5_R__
    	   (uint16_t) (P5_BASE+OFS_P5SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT6_R__
    	   (uint16_t) (P6_BASE+OFS_P6SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT7_R__
    	   (uint16_t) (P7_BASE+OFS_P7SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT8_R__
    	   (uint16_t) (P8_BASE+OFS_P8SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT9_R__
    	   (uint16_t) (P9_BASE+OFS_P9SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORT10_R__
    	   (uint16_t) (P10_BASE+OFS_P10SEL0),
    	#endif
    	#ifdef __MSP430_HAS_PORTJ_R__
    	   (uint16_t) (PJ_BASE+OFS_PJSEL0),
    	#endif
    };
    
    const uint16_t port_to_sel1[] = {
    	   NOT_A_PORT,
    	   (uint16_t) (P1_BASE+OFS_P1SEL1),
    	   (uint16_t) (P2_BASE+OFS_P2SEL1),
    	#ifdef __MSP430_HAS_PORT3_R__
    	   (uint16_t) (P3_BASE+OFS_P3SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT4_R__
    	   (uint16_t) (P4_BASE+OFS_P4SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT5_R__
    	   (uint16_t) (P5_BASE+OFS_P5SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT6_R__
    	   (uint16_t) (P6_BASE+OFS_P6SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT7_R__
    	   (uint16_t) (P7_BASE+OFS_P7SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT8_R__
    	   (uint16_t) (P8_BASE+OFS_P8SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT9_R__
    	   (uint16_t) (P9_BASE+OFS_P9SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORT10_R__
    	   (uint16_t) (P10_BASE+OFS_P10SEL1),
    	#endif
    	#ifdef __MSP430_HAS_PORTJ_R__
    	   (uint16_t) (PJ_BASE+OFS_PJSEL1),
    	#endif
    };
    
    const uint8_t digital_pin_to_timer[] = {
    	NOT_ON_TIMER,  /*  0 - pin count starts at 1 */
    	NOT_ON_TIMER,  /*  1 - Vcc */
    	NOT_ON_TIMER,  /*  2 - P8.1 */
    	NOT_ON_TIMER,  /*  3 - P1.1 */
    	NOT_ON_TIMER,  /*  4 - P1.0 */
    	NOT_ON_TIMER,  /*  5 - P2.7 */
    	NOT_ON_TIMER,  /*  6 - P8.0 */
    	NOT_ON_TIMER,  /*  7 - P5.1 */
    	NOT_ON_TIMER,  /*  8 - P2.5 */
    	NOT_ON_TIMER,  /*  9 - P8.2 */
    	T1A2,          /* 10 - P8.3 */
    	NOT_ON_TIMER,  /* 11 - P1.5 */
    	NOT_ON_TIMER,  /* 12 - P1.4 */
    	NOT_ON_TIMER,  /* 13 - P1.3 */
    	NOT_ON_TIMER,  /* 14 - P5.3 */
    	NOT_ON_TIMER,  /* 15 - P5.2 */
    	NOT_ON_TIMER,  /* 16 - RST */
    	NOT_ON_TIMER,  /* 17 - P5.0 */
    	T0A2,          /* 18 - P1.6 */
    	T0A1,          /* 19 - P1.7 */
    	NOT_ON_TIMER,  /* 20 - GND */
    	
    	NOT_ON_TIMER,  /* 21 - P2.4 */
    	NOT_ON_TIMER,  /* 22 - P2.3 */
    	T1A1,          /* 23 - P4.0 */
    	NOT_ON_TIMER,  /* 24 - P1.2 */
    	NOT_ON_TIMER,  /* 25 - P2.6 */
    };
    
    const uint8_t digital_pin_to_port[] = {
    	NOT_A_PIN,   /*  0 - pin count starts at 1 */
    	NOT_A_PIN,   /*  1 - Vcc */
    	P8,          /*  2 - P8.1 */
    	P1,          /*  3 - P1.1 */
    	P1,          /*  4 - P1.0 */
    	P2,          /*  5 - P2.7 */
    	P8,          /*  6 - P8.0 */
    	P5,          /*  7 - P5.1 */
    	P2,          /*  8 - P2.5 */
    	P8,          /*  9 - P8.2 */
    	P8,          /* 10 - P8.3 */
    	P1,          /* 11 - P1.5 */
    	P1,          /* 12 - P1.4 */
    	P1,          /* 13 - P1.3 */
    	P5,          /* 14 - P5.3 */
    	P5,          /* 15 - P5.2 */
    	NOT_A_PIN,   /* 16 - RST */
    	P5,          /* 17 - P5.0 */
    	P1,          /* 18 - P1.6 */
    	P1,          /* 19 - P1.7 */
    	NOT_A_PIN,   /* 20 - GND */
    
    	P2,          /* 21 - P2.4 */
    	P2,          /* 22 - P2.3 */
    	P4,          /* 23 - P4.0 */
    	P1,          /* 24 - P1.2 */
    	P2,          /* 25 - P2.6 */
    };
    
    const uint8_t digital_pin_to_bit_mask[] = {
    	NOT_A_PIN,   /*  0 - pin count starts at 1 */
    	NOT_A_PIN,   /*  1 - Vcc */
    	BV(1),       /*  2 - P8.1 */
    	BV(1),       /*  3 - P1.1 */
    	BV(0),       /*  4 - P1.0 */
    	BV(7),       /*  5 - P2.7 */
    	BV(0),       /*  6 - P8.0 */
    	BV(1),       /*  7 - P5.1 */
    	BV(5),       /*  8 - P2.5 */
    	BV(2),       /*  9 - P8.2 */
    	BV(3),       /* 10 - P8.3 */
    	BV(5),       /* 11 - P1.5 */
    	BV(4),       /* 12 - P1.4 */
    	BV(3),       /* 13 - P1.3 */
    	BV(3),       /* 14 - P5.3 */
    	BV(2),       /* 15 - P5.2 */
    	NOT_A_PIN,   /* 16 - RST */
    	BV(0),       /* 17 - P5.0 */
    	BV(6),       /* 18 - P1.6 */
    	BV(7),       /* 19 - P1.7 */
    	NOT_A_PIN,   /* 20 - GND */
    
    	BV(4),       /* 21 - P2.4 */
    	BV(3),       /* 22 - P2.3 */
    	BV(0),       /* 23 - P4.0 */
    	BV(2),       /* 24 - P1.2 */
    	BV(6),       /* 25 - P2.6 */
    };
    
    const uint32_t digital_pin_to_analog_in[] = {
            NOT_ON_ADC,     /*  0 - pin count starts at 1 */
            NOT_ON_ADC,     /*  1 - Vcc */
            9,              /*  2 - P8.1 */
            1,              /*  3 - P1.1 */
            0, 	        /*  4 - P1.0 */
            NOT_ON_ADC,     /*  5 - P2.7 */
            8,   	        /*  6 - P8.0 */
            NOT_ON_ADC,   	/*  7 - P5.1 */
            NOT_ON_ADC, 	/*  8 - P2.5 */
            NOT_ON_ADC, 	/*  9 - P8.2 */
            NOT_ON_ADC, 	/* 10 - P8.3 */
            5,              /* 11 - P1.5 */
            4,              /* 12 - P1.4 */
            3,              /* 13 - P1.3 */
            NOT_ON_ADC,     /* 14 - P5.3 */
            NOT_ON_ADC,     /* 15 - P5.2 */
            NOT_ON_ADC, 	/* 16 - RST */
            NOT_ON_ADC,     /* 17 - P5.0 */
            6,		/* 18 - P1.6 */
            7,     		/* 19 - P1.7 */
            NOT_ON_ADC, 	/* 20 - GND */
    		                
            NOT_ON_ADC, 	/* 21 - P2.4 */
            NOT_ON_ADC, 	/* 22 - P2.3 */
            NOT_ON_ADC,	/* 23 - P4.0 */
            2,    		/* 24 - P1.2 */
            NOT_ON_ADC,    	/* 25 - P2.6 */
    };
    #endif // #ifdef ARDUINO_MAIN
    #endif // #ifndef Pins_Energia_h
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我当时想到的是其中之一:

    https://energia.nu/pinmaps/msp-exp430fr2311/

    AfICT,您不能将3和4用于软件序列,因为它们用于序列。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我是否可以使用另一对输入/输出引脚,例如13/14?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我猜是这样。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    再次感谢 Keith 的帮助。 这让我意识到,我所想要的东西在船上是不可能的。 我可能更好地与模块进行芯片外通信,并将控制信号传递给 MSP430。  HC-05也可以通过使用 Nice GUI 的许多蓝牙串行终端应用程序来控制

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我很确定您是错的,与 HC05和 PC 通信时应该没有问题。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此外,43oh 板是一个更好的提出 Energia 问题的地方。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    找到主要问题。 我查阅了 HC-05手册,实际上我有时处于错误的模式。 我想我会发布解决此问题的步骤。

    关键是 HC-05上的红色 LED:它有三种状态。

    快速闪烁-正在寻找配对但未配对

    慢速闪烁-已配对

    慢速双闪-在命令模式下。

    我本不应该使用软件串行-它与我的主板不兼容(与16MHz CPU 问题有关-不完全确定)。  

    使用 RX/TX 引脚并通过 Serial()进行通信是 HC-05通过此发送数据的方法。

    另一个问题是,使用所有苹果设备意味着一旦建立连接,我就无法连续地与 HC-05进行交互,通过蓝牙终端发送数据。 实现这一目标的理想方式是使用 Android 手机和蓝牙串行应用程序。

    这篇文章真的很好: https://circuitdigest.com/microcontroller-projects/interfacing-hc-05-bluetooth-module-with-msp430-launchpad-to-control-an-led

    感谢您的帮助-很高兴我成功地解决了这一问题,现在可以将其扩展到我需要的用途