无法保存波特率设置? [英] Can't save baud rate settings?

查看:373
本文介绍了无法保存波特率设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,我将GSM调制解调器设置为115200波特率。我有PIC18微控制器连接到它与19200波特率。我将调制解调器波特率更改为19200,然后保存设置,但每次重置调制解调器,波特率更改回115200.



这些是以下命令我用了。



更改波特率



AT + IPR = 19200



然后我用19200波特率重新打开超级终端(Putty)以保存当前设置。



保存设置



AT& W p>

但是在重置调制解调器后,波特率变回115200.我使用的是M6000 GSM / GPS模块(Tk115 Gps Tracker),但是没有很多支持,请参阅数据表




我正在储存设定吗?波特率为115200在我的PIC18F87j11,但它不可能与当前的8毫亨振荡器。任何反馈都会有帮助。



谢谢!

解决方案

解决方法(但可能不是最好的选择)是将您的波特率保存到内部闪存存储,然后有一个单独的线程连续设置您的端口的波特率。




这样的线程;

  while $ b {
MySerialPort.BaudRate = 19200; //这将设置/更新波特率
Thread.Sleep(30000); //这将睡30秒
}

每30秒保存一次波特率;



第一个示例





是您在程序启动时读取内部闪存存储器,并从存储在那里的值分配波特率。



对于在超级终端/等设置波特率 - 这些只是临时波特率 - 有点像调谐收音机 - 你可以听到不同的东西从不同的波特率 - 这是怎么回事超级终端工作 - 它不保存波特率,只分配一个临时时间(直到你关闭和在收音机上)。



对于BootLoader ,应该有一种退出引导程序模式的方法 - 看看你的微控制器的文档,因为它应该只有当你更新你的MC或'闪烁'更新 - 不是不断(引导加载程序就像按复位按钮)!


The GSM modem I have is set to 115200 baud-rate by default. I have PIC18 Microcontroller connected to it with 19200 baud-rate. I changed the modem baud-rate to 19200 then saved the settings but every time I reset the modem, the baud-rate changes back to 115200.

These are the following commands I used.

Change baudrate

AT+IPR=19200

Then I reopened the hyper-terminal (Putty) with 19200 baud-rate to save the current settings.

Save settings

AT&W

But upon reset of the modem, the baud-rate changes back to 115200. I am using M6000 GSM/GPS Module(Tk115 Gps Tracker) but there isn't a lot of support for it, here is the datasheet for reference.

Am I saving the settings correctly?

I was thinking about changing the baud-rate to 115200 on my PIC18F87j11 but it's not possible with the current 8 mhz oscillator. Any feedback would be helpful.

Thanks!

解决方案

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

OR A thread like;

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

Will save the Baud rate every 30 seconds;

First Example

Or going with my first example (where baud rate is saved to flash)

is that in your program startup, you read your internal flash storage, and from the value stored there you assign the baud rate.

As for setting the baud rate in HyperTerminal/etc - these are only 'temporary' baud rates - A bit like tuning a radio - you can hear different things from different baud rates - that's how hyperterminal works - it doesn't 'save' the baud rate, only assigns it for a temporary time (until you turn off and on your radio).

As for BootLoader, there should be a way of 'exiting' bootloader mode - have a look at your microcontrollers' documentation as it should only be on when you are updating your MC or 'Flashing' an update - not on constantly (Bootloader is like pressing the 'reset' button on your PC)!

这篇关于无法保存波特率设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆