8 years, 6 months ago.

Dual serial port

I am trying to connect a GPS module (with serial interface) to my mDot, but I want to keep the serial link with PC through DB9 for debugging. Communication with PC works OK:

Serial pc(PA_2, PA_3);
pc.baud(115200);
pc.printf("hello...\n\r");

but when I try to add the second serial link, for example:

Serial gps(PC_13, PA_0);
gps.baud(9600);

the connection with the PC dies. Is it possible to have two serial ports working a t the same time?

Question relating to:

The MultiConnect® mDot™ offers significantly longer range and improved radio performance compared to traditional wireless solutions—resulting in greater transmission range and reduced capital expense.

4 Answers

8 years, 6 months ago.

There are a limited number of pins available on the MTDOT footprint, so not every device is available on every pin.The release version of the MTDOT actually uses a STM32F411, in the TQFP 64 package, and it has 3 USARTS avaliable (1,2,and 6). According to the data sheet for the F411 some pins are alternate positions for the same USART. MTDOT pins 8 (PA_12) and 9 (PA_11) are capable of being set to USART6. PA_11 is USART6_TX and PA_12 is USART6_RX. You should be able to use these two pins as an additional serial port. The main serial port on MTDOT pins 2 and 3 is USART2. The debug serial port on the UDK is connected to MTDOT processor pins PA_9 and PA_10 and is using USART1.

Tim Barr MultiTech Systems Inc.

Accepted Answer

Thanks Timothy. Very clear information. I have moved the debug serial port to USART1 (USB) and connected the GPS to USART2 (default). My problem is solved. Now I will try USART6, in order to have a third port, just in case I need it. One last question: is mDot pint 8 available in the development kit? Is there any precaution regarding its usage (I see it is labeled as Reserved).

posted by Alejandro Veiga 03 May 2016

Some of the pin definitions on the MDOT are xBee holdovers, such as pin 8. Since pin 8 on the xbee footprint is recommended to be no-connect, we went ahead and added a processor pin to that module pin. There is a table in the MDOT Developer Guide that has more accurate information on the available pins. http://www.multitech.com/manuals/s000612_2_0_6.pdf

posted by Timothy Barr 03 May 2016

Thanks again!

posted by Alejandro Veiga 05 May 2016
8 years, 6 months ago.

https://developer.mbed.org/users/Sissors/code/SoftSerial/

May be this link can help you

8 years, 6 months ago.

Often this would work, but if a board only has a single Serial peripheral (hardware) that is shared between different pins, then you cannot use both at the same time. SoftSerial can indeed help you out in that case.

I understand mDot is based around an STM32F405RG processor. In its datasheet it says

"Up to 4 USARTs/2 UARTs (10.5 Mbit/s, ISO 7816 interface, LIN, IrDA, modem control)"

So I was hoping to have two real UARTs available. Anyway, I will try SoftSerial for the debugging console. Thanks for your reply

posted by Alejandro Veiga 01 May 2016
8 years, 6 months ago.

I have just run into the same problem (I think - see 2, below)

1) First let me ask... Tim wrote:

MTDOT pins 8 (PA_12) and 9 (PA_11) are capable of being set to USART6. PA_11 is USART6_TX and PA_12 is USART6_RX."

My docs show pin 8 as Reserved. Can you clarify?

2) I am using USB for my debug. Am I going to have the same problem?

The mbed USB interface is connected to USART1 of the mDot through the virtual comport. These are pins on the programming interface that is separate from the standard xBee footprint.

posted by Timothy Barr 03 May 2016