完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嘿,伙计们,我有一个项目,我有一些问题要做。它是通过蓝牙模块接收信息并执行某些操作的移动设备。信息是通过Android手机发送的。事情是:我知道到目前为止,如何使它工作,但我想让它移动,所以我想使用蓝牙低能量(BLTE /蓝牙智能)和极端Low Power PIC(XLP)。除此之外,我想让PIC入睡并通过它的RX PIN接收到一些东西。我遇到的问题是:我已经阅读了PIC16LF1933的数据表(但是我打开了另一个PIC,比如PIC16LF1825,因为它只有14个引脚,我不想要大图片),我可以设置WUE位。启用自动唤醒并使PIC入睡。但我不能用中断字符信号唤醒它。我用proteus仿真它,并使用虚拟终端发送信息。当你按下Ctrl + Shift +@时,它发送一个空字符,hh,这应该唤醒PIC,但是在我收到的日志中,我使用了9600个波特率。当然,我想要接收下一个中断字符。注意到我不知道如何考虑来解决这个问题:ET说,中断电平信号必须是10或更多的比特时间0。我不知道蓝牙模块是否能够发送这个长中断。我不知道如何通过我的Android应用程序发送它。我不知道我是否能收到10位0的**应用程序使用OutPoSt流通过蓝牙发送东西。写方法通过一个位数组,所以,也许,我可以传递所有的零点和多少个我想要的。但我仍然不知道蓝牙模块将如何接收这些数据并传送给PIC。***如果我不能让这个唤醒事件工作,我就不会把照片放在睡眠中,希望它不会一直耗尽我的电池。
以上来自于百度翻译 以下为原文 Hey guys, I have a project and I'm having some problems to make it work. It is mobile device that receives information via a Bluetooth Module and executes something. The information is sent via a Android Phone. The thing is: I know so far how to make it work, BUT I want to make it mobile, so I thought of using a Bluetooth Low Energy (BLTE / Bluetooth Smart) and a eXtreme Low Power PIC (XLP). And, besides that, I want to put the PIC to sleep and wake when receive something via its RX pin. The problema I'm having: I've read the datasheet of pic16LF1933 (but I'm open of using another PIC, like pic16LF1825 cause it has only 14 pins and I don't want big PICs) and I'm able to set the WUE bit to enable the Auto Wake-up and put the PIC to sleep. But I'm not able of waking it up with the Break Character Signal. I'm emulating it with Proteus and using Virtual Terminal to send information. When you press CTRL + SHIFT + @ it sends a NULL character, 00h, that should wake up the PIC, but in the log I receive Wake up event is only 937.500003us wide. Minimum (at current baudrate) expected is 6.656ms. I'm using 9600 baudrate. And, of course, I want to receive what comes next the Break Character. Noticeable mention that I don't know how to consider to solve the problem: - The datasheet says the break level signal has to be 10 or more bit times 0's. I don't know if the Bluetooth Module is able to send this long break. I don't know how to send it via my Android App*. I don't know if I can receive a 10 bit 0's. *The App uses OutputStream to send something via Bluetooth. The Write method passes a array of bits, so, maybe, I can pass all zeros and how many I want. But I still don't know how the Bluetooth Module will receive this data and transmit to the PIC. ****If I'm not able to make this Wake up Event work I'm just gonna not put the PIC to sleep and hope that it doesn't drain my battery all the time. |
|
相关推荐
5个回答
|
|
Proteus可以或可能不正确地模拟硅中的所有情况。唯一真正的测试是真实的设备如何工作。(任何类型的模拟器都有自己的位置,但它们也引入了另一级别的潜在bug和不同的操作。)通过UART发送0x00与发送中断并不相同,因为字节将包含开始位(并且可能包括停止位和奇偶校验位),这会干扰硬件的“断路”检测电路,我知道它没有帮助,但你不是第一个遇到这个问题。我看到过将Rx线链接到外部中断管脚并触发该管脚的尝试,但我不知道它是否有效,更不用说在生产环境中可靠地触发了。
以上来自于百度翻译 以下为原文 Proteus may or may not correctly simulate all situations in the silicon. The only real test is how the real device works. (Simulators of any sort have their place but they also introduce another level of potential bugs and different operations.) Sending 0x00 via a UART is NOT the same thing as sending a break as the byte will contain start bits (and possibly stop and parity bits) what will interfere with the hardware's 'break' detection circuit. I know it does not help but you are not the first to encounter this problem. I've seen attempts to link the Rx line to an external interrupt pin and trigger on that but I have no idea if that works at all, let alone reliably for a production situation. Susan |
|
|
|
苏珊,谢谢你的回答。我听说0x00和断路信号不一样,但是谁告诉我不确定,那一定是真的,谢谢你。我还被告知,蓝牙模块不能发送这么低的时间,只有当我低波特率飞行(我被告知把1200),并把它回到9600。但我不知道这样做是否可行,以及如何做到这一点,因为蓝牙模块只是从mu Android接收信息,并将其发送到PIC。有什么提示吗?
以上来自于百度翻译 以下为原文 Susan, thanks for your answer. I was told that 0x00 was not the same as a Break Signal, but who told me was not sure, it must be true, thanks for that. I was also told that a Bluetooth Module can't send that much low time, only if I low de baud rate on the fly (I was told to put it to 1200) and put it back to 9600. But I don't know if that would work and how to do that, cuz the Bluetooth Module was only to receive information from mu Android and send it to the PIC. Any tips? |
|
|
|
我认为,如果接收机被设置为9600波特率,那么降低bt模块的波特率和发送0x00将触发中断检测,因为同步中断检测器触发的低周期可能很长。我强烈建议你在真实的硬件上尝试,并确定它是否可靠地工作。
以上来自于百度翻译 以下为原文 I think that lowering the baudrate of the bt module and sending 0x00 would trigger the break detection if the receiver was set to 9600 baud rate as the low period would probably be long enought for the sync break detector to trigger. I strongly suggest you to try this on real hardware and determine if it works reliably. |
|
|
|
是的,中断通常是像12位时间@ 0(见DMX协议的例子)
以上来自于百度翻译 以下为原文 Yeah, Break is usually something like 12 bit-time @0 (see DMX protocol for an example) |
|
|
|
如果我正确地理解了OP,他希望接收的PIC进入睡眠状态,被一些外部设备唤醒。我认为在这种情况下,他需要提高PIC的UART波特率,因为改变外部发射机的波特率可能很困难。苏珊
以上来自于百度翻译 以下为原文 If I understand the OP correctly, he wants the received (the PIC) to go to sleep and be woken by some external device. I think in that case he would need to raise the PIC's UART baud rate as changing the external transmitter's baud rate might be hard. Susan |
|
|
|
只有小组成员才能发言,加入小组>>
5178 浏览 9 评论
2003 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3177 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
737浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
635浏览 0评论
533浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 11:10 , Processed in 1.366954 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号