1
\$\begingroup\$

I have a simple project that basically sends and receives data through USB connection and Bluetooth. Both the USB module and the BT module share the same UART RX (P1.2) and TX (P1.1) ports.

The problem I am having is that when the bluetooth is powered, I can't send commands to the MSP430 with the USB module. If I unplug the BT module, I can send just fine over USB.

Am I connecting them incorrectly, or do I need to disable the BT when using USB?

The USB module is based on FT232R: https://www.sparkfun.com/products/9716

The BT module is based on RN-42: https://www.sparkfun.com/products/10269

USB connections:

  • GND --> GND
  • CTS --> GND
  • 3V3 --> N/C
  • TXD --> P1.1
  • RXD --> P1.2
  • DTR --> N/C

BT connections:

  • CTS-I --> N/C
  • VCC --> 3.3V
  • GND --> GND
  • TX-D --> P1.1
  • RX-I --> P1.2
  • RTS-D --> N/C
\$\endgroup\$
2
\$\begingroup\$

The Arduino has the same issue, and they have implemented a fix a long time ago.

image

As you can see in the image, Resistors RN4B and RN4A are 1k series resistors between the USB-Serial ic and the Arduino's ATMega328p. This allows a device connected directly to the Arduino headers, like a shield/boosterpack to communicate with the Arduino without interference from the USB-Serial IC.

You want to implement the same thing. Place 1k resistors between your MSP430 and your Bluetooth module. This will mean that the USB-Serial connection has precedence over the Bluetooth module. Any communication between the USB-Serial and the MSP430 will not be interfered by the Bluetooth module. That said, you cannot send/receive from the bluetooth module when the USB-Serial connection is plugged in.

Update: This may not always work though. Some devices, when there is no usb signal on one side, will turn the tx/rx into floating/open inputs, instead of driving the line, which is good, but others, when off can still siphon power via clamping diodes in gpio pins. It can be a pain because this means they attempt to drive the line, preventing others from doing so.. In your case, you might need a bi-directional multiplexer, or simpler, if the usb serial is only occasionally used, you could add a jumper to the line. Plug in the jumper when you need to use the usb connection, remove it when you don't.

\$\endgroup\$
  • \$\begingroup\$ I tried putting the 1k resisters in series with the BT. The USB can now send, but like you said, the BT can't send anymore. I thought the FTDI module should be off when I unplug the USB cable since I am not connecting 3.3V to the 3V3 connection. \$\endgroup\$ – user2218339 Nov 7 '13 at 22:11
  • \$\begingroup\$ @user2218339 Most devices can siphon power via clamping diodes in gpio pins. It can be a pain. In your case, you might need a bi-directional multiplexer, or simpler, if the usb serial is only occasionally used, you could add a jumper to the line. Plug in the jumper when you need to use the usb connection, remove it when you don't. \$\endgroup\$ – Passerby Nov 7 '13 at 22:53
  • \$\begingroup\$ Yea, I guess that would be the simpliest idea. Thanks for the suggestions. \$\endgroup\$ – user2218339 Nov 8 '13 at 0:00
1
\$\begingroup\$

Both the USB and the BT share the same GPIO pins, use different ones for each module. I assume you have only one UART, so it will require some additional logic or software.

\$\endgroup\$
  • \$\begingroup\$ Yes, you are correct. There is only one UART on my chip (g2553) \$\endgroup\$ – user2218339 Nov 7 '13 at 22:16
1
\$\begingroup\$

You are connecting them incorrectly.

Bluetooth module and USB-to-serial converter (I'll be calling it FTDI for short) share the same UART pins. They are connected in parallel to the same UART.

  • When you send data on UART TX, how would the BT know that it and not the FTDI should transmit?
  • It's even worse with UART RX. When BT is not sending data to MSP430, it still drives the UART RX line low, it doesn't disappear out of the picture. FTDI can not drive the UART RX line high in this condition. When you plug in the BT module and lose the ability to send commands via FTDI, that's what's happening.

Typically, there would be separate UARTs for Bluetooth and FTDI.
Alternatively, you could add a multiplexor to your schematic so that the microcontroller's UART "sees" only one device at a time.

\$\endgroup\$
  • \$\begingroup\$ I'm using the MSP430G2553 chip, I think there is only one set of UART pins. I might have to try adding a multiplexor. \$\endgroup\$ – user2218339 Nov 7 '13 at 22:16
  • \$\begingroup\$ @user2218339 it has only one hardware UART, but you could use a software uart code as well. \$\endgroup\$ – Passerby Nov 8 '13 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.