- Thu Jun 10, 2021 7:11 am
#50982
I had another issue with a Bluetooth module today and so decided to take a deeper look into this issue. I was unable to establish comms between Tuner Studio and the Arduino via the BT module connected to Serial 1 (pins 0/1)
So I set up some tests using the Mega Pro, a UART serial adaptor and a BT module.
First I set up a test to transmit directly between BT and UART modules. I wanted to take the mega out of the equation and see if comms would work peer-to-peer. I connected the modules to each other (rx-tx / tx-rx) and used two instances of SerialTerm to send and receive data between the devices. The UART was set to 5v. Both devices sent and received data with no issues. So far, so good.
Next I did a test using the serial monitor in the Arduino IDE and the BT module connected to Serial 2 (pins 18/19). I wrote a quick sketch to passthrough the data between Serial 1 and Serial 2. Again the test was successful.
Next I wanted to test the BT module connected to Serial 1 (Pins 0/1) however these pins are also connected to the USB port so it is not possible to use both the BT module and the USB port at the same time. This in turn meant that I could not use the serial monitor in the Arduino IDE to test. So I connected the BT module to Serial 1 and connected the UART module to Serial 2 and used two instances of SerialTerm. Again I used the sketch to pass data between Serial 1 and Serial 2.
What I found was very interesting. It was possible to send data from the UART to the BT module (via the mega) but not the other way around. Commands typed into the UARTs serial terminal appeared in the BT's serial terminal, but commands typed into the BT's serial terminal did nothing / went nowhere.
To validate what I had found I swapped the connections for the UART and BT modules over and found the same thing happened to the UART module when connected to Serial 1. Commands typed into the BT's serial terminal appeared in the UARTs serial terminal but not vice versa.
This seems to point towards an issue with the TX line (Pin1), and I'm guessing is most likely related to the CH340 serial chip on the Mega Pro somehow affecting the TX line.
So next I desoldered the CH340 and then retried connecting using Tuner Studio and it connected first time. Bingo.
So I now have an idea of what is causing the issue, but not an exact cause. Nor do not have a fix at this stage as removing the CH340 chip is not really a workable solution.
Blocking diodes may work, but there is no way to implement them as the issue resides on the mega itself. I tried adding a pullup resistor to the TX line, but this did not work.
Happy for any suggestions...
/DM
So I set up some tests using the Mega Pro, a UART serial adaptor and a BT module.
First I set up a test to transmit directly between BT and UART modules. I wanted to take the mega out of the equation and see if comms would work peer-to-peer. I connected the modules to each other (rx-tx / tx-rx) and used two instances of SerialTerm to send and receive data between the devices. The UART was set to 5v. Both devices sent and received data with no issues. So far, so good.
Next I did a test using the serial monitor in the Arduino IDE and the BT module connected to Serial 2 (pins 18/19). I wrote a quick sketch to passthrough the data between Serial 1 and Serial 2. Again the test was successful.
Next I wanted to test the BT module connected to Serial 1 (Pins 0/1) however these pins are also connected to the USB port so it is not possible to use both the BT module and the USB port at the same time. This in turn meant that I could not use the serial monitor in the Arduino IDE to test. So I connected the BT module to Serial 1 and connected the UART module to Serial 2 and used two instances of SerialTerm. Again I used the sketch to pass data between Serial 1 and Serial 2.
What I found was very interesting. It was possible to send data from the UART to the BT module (via the mega) but not the other way around. Commands typed into the UARTs serial terminal appeared in the BT's serial terminal, but commands typed into the BT's serial terminal did nothing / went nowhere.
To validate what I had found I swapped the connections for the UART and BT modules over and found the same thing happened to the UART module when connected to Serial 1. Commands typed into the BT's serial terminal appeared in the UARTs serial terminal but not vice versa.
This seems to point towards an issue with the TX line (Pin1), and I'm guessing is most likely related to the CH340 serial chip on the Mega Pro somehow affecting the TX line.
So next I desoldered the CH340 and then retried connecting using Tuner Studio and it connected first time. Bingo.
So I now have an idea of what is causing the issue, but not an exact cause. Nor do not have a fix at this stage as removing the CH340 chip is not really a workable solution.
Blocking diodes may work, but there is no way to implement them as the issue resides on the mega itself. I tried adding a pullup resistor to the TX line, but this did not work.
Happy for any suggestions...
/DM
He who controls the boost controls the universe