Enabling UART2 Programaticaly


#1

Hi,
Is it possible to enable UART2 and set baud rate to 9600 programaticaly? I wanted to put some code in my appliction which will do the said job. As Q2686 modules comes with UART2 disable and baud rate is set to 115200.
Regards,
Asish


#2

Yes: you just issue the same AT commands as you would to do it manually - making sure to specify the correct port parameter…

That depends on which firmware version you have - it (and USB) defaults to enabled with the latest versions.

forum.sierrawireless.com/viewtop … =15#p17354

The default is autobaud, surely?


#3

Hi friend,
Thanks for the reply. I will try with at command to enable the UART2. I’m using firmware version 7.3a and my requirement is 9600 baud for UART2. How can i set baud rate from my application?


#4

I answered that in my previous reply :exclamation:


#5

Good morning all,

Just a comment on the earlier posts, if I am not mistaken, as of firmware 7.4 UART1 and USB is enabled as per default when product is shipped from SWI. UART2 still needs to be enabled.

As for the baud rate (and any other AT commands that needs to be issued to have an effect on the actual port) must bee executed with the ADL_PORT_TYPE() macro as per Awneil’s advice.

Also, default baudrates are 115200bps however it seems that USB just accepts any baudrate, no matter which rate you set it to. (This seen with 7.43)

Regards,
Tyrone


#6

I thought both USB and UART2 were enabled by default from R7.4?

To be precise, the default is Auto-Baud but, if the module has not had any incoming communications from the external application, it will use 115200 to send any responses.

Yes, this is documented: baud rate and flow control are meaningless to USB - the commands are accepted (for compatibility), but have no effect.


#7

Just to clarify that:

Baud and flow control are meaningless to USB itself; they are only meaningful when you’re using a USB-to-UART converter (such as a USB-to-RS232 adaptor cable) - and then they only apply to the UART output, not the USB itself.