Can't save the baud rate settings?

The default GSM modem is set to 115200 baud. I have a PIC18 microcontroller connected to it at 19,200 baud. I changed the modem data rate to 19200, then saved the settings, but every time I reset the modem, the data rate changes to 115200.

These are the following commands that I used.

Transfer rate change

AT+IPR=19200

Then I reopened the Putty hyperterminal at 19,200 baud to save the current settings.

Save Settings

AT&W

But after resetting the modem, the data transfer speed will change to 115200. I use the M6000 GSM / GPS module (Tk115 Gps Tracker), but there is not much support for this, here is a table for reference.

Do I save the settings correctly?

I was thinking about changing the baud rate to 115200 on my PIC18F87j11, but this is not possible with the current 8 MHz oscillator. Any feedback would be helpful.

Thanks!

+5
source share
4 answers

A possible workaround (but probably not the best option) is to save the data rate to the internal flash memory, and then have a separate stream that continuously sets the baud rate of your port.

OR Thread like:

 while (true) { MySerialPort.BaudRate = 19200; //this will set/update baud rate Thread.Sleep(30000); //this will sleep for 30 seconds } 

Saves transmission speed every 30 seconds;

First example

Or with my first example (where the transfer rate is stored in Flash)

It means that when you start your program, you read the internal flash memory, and from the value stored there you assign the transfer rate.

As for setting the baud rate in HyperTerminal / etc, these are only "temporary" baud rates. It’s a bit like tuning the radio - you can hear different things from different baud rates, how the hyperterminal works - save 'the transmission speed, assigns it only temporarily (until you turn the radio off and on).

As for BootLoader, there should be a way to exit bootloader mode - look at the documentation of your microcontrollers, since it should only be turned on when you update your MC or "Flashing" update - not constantly (for example, the bootloader is like pressing the "reset" button "on your PC)!

+3
source

Your attempt to correct the baud rate by combining AT+IPR and AT&W correct, but unfortunately this does not necessarily work.


The AT&W command is not actually specified in any standard (see my question What standard does the AT & W AT command indicate? ), So this means that exactly what AT&W stores is completely dependent on manefacturer, and you (unfortunately) you can’t take anything regarding the preservation of the baud rate.

Of course, if manefacturer clearly indicates that AT&W does maintain transmission speed, then you should go (for this particular device), but the document associated with it does not even include AT&W in the list of commands ... Therefore, when you check and find that your Since the modem does not save the data transfer rate, this is an unfortunate fact that you must accept.


When you say that it is not possible to change the baud rate, I assume that you mean that the problem is that 8MHz is not easy to divide up to 115200, so the error marker becomes carelessly large, as shown in the 8 MHz table with WormFood AVR Ba Rate Rate Calculator , right?

The table shows the error of 7.8% for 8 MHz, but is the modem tolerant to reception? If one of the X attempts succeeds, that’s all you need, as the speed will be set as you need, for example. try AT+IPR=19200 on 115200, and then check AT on 19200. If successful, do this, try again. Maybe it will be good enough and will be resolved after a resonant time? I think it's worth a try.

Alternatively, you could try writing an interrupt routine to send the start + data + stop bit for "AT+IPR=19200\r" at 115200 at the GPIO pin and connect only to see if it is possible to speed up the speed modem (see http://www.fpga4fun.com/SerialInterface2.html for calculations with lower frequencies). You will probably need additional adaptation of the electrical signal for this, as well as find a way to multiplex GPIO and UART.

+2
source

I'm not sure why you will need to change the data transfer speed, especially since I think that many of them will be connected by a dynamic connection, right? It has been a long time since I finished programming the modem.

In any case, the Demetris poster noted the importance of AT & W - this is what actually gets the change. Think you need to have this in your script.

If this helps, this site at least documents some basic things you can do with this type of modem. You probably already found it, but maybe other readers haven’t!

http://smsiseasy.com/technicalinfo.html

-1
source

The AT & W command must be sent at a new baud rate. In other words, after changing the transmission speed to 19200, the modem cannot receive commands at the old speed. Try changing the baud rate to 19200 before sending AT & W.

-1
source

Source: https://habr.com/ru/post/1200773/


All Articles