完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我使用一个PIC32 MX795F12微控制器和一个RN42蓝牙到UART模块。我可以发送文本到UART,在115200波特没有问题。使用P腻y,我也可以输入命令$$进入命令模式并获得CMD响应。不幸的是,我无法使用C代码进入命令模式。我这样做的命令如下:“UART3WrreEnStand($$ $$)”;“函数定义为:},当我这样做时,RN42不进入命令模式。它只是在没有CMD响应的情况下输出$$。有什么想法吗?谢谢!
以上来自于百度翻译 以下为原文 I am using a PIC32MX795F12 microcontroller together with a RN42 bluetooth to UART module. I can send text to the UART with no problem at 115200 baud. Using Putty I can also enter the command $$$ to enter the command mode and get the CMD response. Unfortunately I've not been able to enter the command mode using the C code. My command to do this is as follows: "UART3WriteString("$$$");"where the function is defined as: void UART3WriteString(const char * str) { while( *str ) { U3TXREG = *str++; while( U3STAbits.TRMT == 0 ); //wait for the transmission to be done) }} When I do this, the RN42 does not go into the command mode. It just outputs $$$ without the CMD response. Any ideas? Thanks! |
|
相关推荐
2个回答
|
|
|
好的,我在Microchip站点的热门话题中找到了答案。基本上我需要在发布$$ $命令之前和之后插入一个250毫秒的缓冲区。否则,RN42将不会进入命令模式。
以上来自于百度翻译 以下为原文 Ok, I found the answer in the hot topics part of the microchip site. Basically I need to insert a 250 ms buffer before and after issuing the $$$ command. Otherwise the RN42 will not enter Command mode. |
|
|
|
|
|
这是一个很长的历史,回到1980调制解调器的海因斯调制解调器中,虽然他们使用了“+++”和一秒钟的延迟。http://En.维基百科…org……如果你这样做,你可能需要使你的250MS延迟更长一点,或者在调用延迟之前添加一个等待TrMT。
以上来自于百度翻译 以下为原文 You got it. This has a long history, going back to Hayes modems in the 1980's, although they used "+++" and a one second delay. https://en.wikipedia.org/..._set#Hayes.27_solution Note, your transmit routine is inefficient, it prevents the PIC doing anything while the UART peripheral does the transmitting. You can make it more efficient by changing to: void UART3WriteString(const char * str) { while( *str ) { while (U3STAbits.UTXBF); //wait until room in transmit buffer U3TXREG = *str++; } } If you do this, you may need to make your 250ms delay a little longer, or add a wait for TRMT before calling the delay. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 02:38 , Processed in 0.760402 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
909