完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我对RN4020非常陌生,我可以跟我的板上的外设RN4020进行对话,下面的步骤是:PoPuto当我想和它交谈(命令模式)的时候,我做了以下几点:但是,我遇到了WaveKSW在开始和离开时设置高的示例代码。然后,通过切换CMD/MLDP线来输入“命令模式”。正确的顺序是什么?当做
以上来自于百度翻译 以下为原文 Hello, I am very new to Rn4020; I was able to talk to the RN4020 configured as a peripheral on my board following the steps below: On powerup // Configure IOs as output CMD_MLDP_TRIS = 0; WAKE_SW_TRIS = 0; WAKE_HW_TRIS = 0; // Set IOs WAKE_SW_LAT = 0; WAKE_HW_LAT = 1; CMD_MLDP_LAT = 0; Then when I wanted to talk to it (command mode), I did the following: // configured as outpu CMD_MLDP_TRIS = 0; WAKE_SW_TRIS = 0; WAKE_SW_LAT = 0; CMD_MLDP_LAT = 0; 100 ms delay WAKE_SW_LAT = 1; However, I have come across sample codes where the WAKE_SW is set high on start and left there; and "command mode" is entered by toggling the CMD/MDLP line. What is the correct sequence? Regards |
|
相关推荐
5个回答
|
|
Hyoi使用下面的代码启动COMS:这会从RN4020模块产生一个“CMD”响应。
以上来自于百度翻译 以下为原文 Hi hlao I use the following code to initiate coms: BT_Wake_HW = 0; Delay(2); BT_Wake_HW = 1; // Wake up Bluetooth module HW BT_Wake_SW = 0; Delay(2); BT_Wake_SW = 1; // Wake up Bluetooth module UART BT_CMD = 0; // Set to Command mode This generates a 'CMD' response from the RN4020 module. Regards Søren |
|
|
|
谢谢你的回复。我还是有点困惑的文件:Wakysw是用来控制运行状态的RN4020。当WAKEKSWW设置为高时,模块唤醒并被设置为活动模式。唤醒后,“CMD”将输出到UART,并指示模块处于命令模式并准备从UART获取命令。相反,当WAKEYSW被设置为低时,MMODULE通过输出“结束”到UART退出命令模式,然后运行IDEP休眠模式。除非UART波特率为2400 BPS,否则UART接口将不会在深度睡眠模式下响应。当模块处于深度休眠模式时,MLDPYEV(引脚11)将被保持低。CMD/MLDP(PIN 8)被用于控制MLDP串行数据服务(参见2.3.7)Microchip MLDP命令“”时的RN4020模块。一旦通过设置CMD/MLDP高来输入MLDPmode,从UART的所有数据作为数据流被发送到对等设备。为了退出MLDP模式,必须将CMD/MLDP设置为低电平,通过将“CMD”输出到UART,RN4020模块返回到命令模式。设置WAKEYHW(PIN 15)从休眠模式唤醒RN4020模块。然后低,然后再被视为一个周期,在前五秒,RN4020模块执行工厂复位。当工厂重置完成时,IFWAKEK-SW很高,工厂重置完成;否则,它是部分工厂重置,保留设备名、私有服务和脚本。请参阅第2.3.1节“SET/GET命令”以了解“SF,1”描述工厂缺省的信息。如何安全地将其放入CMD然后MLDP并再次返回,而不必担心“休眠模式”?
以上来自于百度翻译 以下为原文 Thank you for your response. I am still a bit confused as for the document: WAKE_SW is used to control the operating state of the RN4020. When WAKE_SW is set high, the module wakes up and is set into Active mode. Upon waking up, “CMD” will be output to the UART and indicate that the module is in Command mode and ready to take commands from UART. Conversely, when WAKE_SW is set low, the module exits Command mode by outputting “END” to the UART, and then operates in Deep Sleep mode. The UART interface will not be responsive in Deep Sleep mode unless the UART baud rate is 2400 bps. When the module is in Deep Sleep mode, MLDP_EV (pin 11) will be held low. CMD/MLDP (pin 8) is used to control the RN4020 module when an MLDP serial data service (see Section 2.3.7 “Microchip MLDP Commands”) is used. Once MLDP mode is entered by setting CMD/MLDP high, all data from the UART is sent to the peer device as a data stream. To exit MLDP mode, CMD/MLDP must be set low so that the RN4020 module is returned to Command mode by outputting “CMD” to the UART. Setting WAKE_HW (pin 15) high wakes the RN4020 module from Dormant mode. After powering up, if WAKE_HW flips up and down three cycles (putting the WAKE_HW pin into high, and then low, and then high again is considered one flip cycle) in the first five seconds, the RN4020 module performs a factory Reset. If WAKE_SW is high when a factory Reset is performed, the factory Reset is complete; otherwise, it is a partial factory Reset that retains the device name, private service, and scripts. Refer to Section 2.3.1 “Set/Get Commands” for information on “SF,1” describing factory default. How do I safely put it into cmd then MLDP and back again without the fear of "dormant mode"? |
|
|
|
在我准备进入命令模式之前,有什么特别的事情需要在RN4020上做吗?
以上来自于百度翻译 以下为原文 Does anything special need to be done on power-up to the RN4020 before I am ready to go into command mode? |
|
|
|
我直接向RN4020发送配置命令-记住寻找回复或等待。重新启动命令需要一点耐心,因为我的RN4020S需要1200到1300毫秒重新启动。
以上来自于百度翻译 以下为原文 I go directly to sending configuration commands to the RN4020 - Remember to look for the reply or wait. The reboot command requires a bit of patience as my RN4020s takes 1200-1300 ms to reboot. BT_CMD = 0; // Set to Command mode Delay(4); memcpy(CommandBuffer,"SF,1n",5); // SF - Command -> Factory reset cnt = 0; while (cnt < 5) { DRV_USART2_WriteByte(CommandBuffer[cnt]); // while (U3STAbits.UTXBF) // Wait for buffer to empty { } cnt++; // Next byte } Delay(100); memcpy(CommandBuffer,"SR,00000000n",12); // SR - Command -> Set Roles |
|
|
|
你如何写你的手机应用程序发送数据与MLDP模式打开?我没有看到任何开始的例子,有没有一个应用笔记来显示细节?
以上来自于百度翻译 以下为原文 How do you write your phone app to send out the data with the MLDP mode turned on? I don't see any examples of getting that started, is there an app note to show the details? |
|
|
|
只有小组成员才能发言,加入小组>>
5243 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3208 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2258 浏览 5 评论
778浏览 1评论
671浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
597浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
679浏览 0评论
577浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 11:25 , Processed in 1.416584 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号