Microchip
直播中

陈桂平

8年用户 274经验值
私信 关注
[问答]

应对接收器延迟

HI是一个普遍的问题,假设发射机每2ms发送32字节的数据,但是接收器只能接收每10ms的数据,因为处理该数据所需的时间。一个ISR可以比10ms更早地调用,并且可以使用一个缓冲区,但是没有任何停机时间,因此缓冲区永远不会足够大。有什么办法解决这个问题吗?谢谢

以上来自于百度翻译


      以下为原文

    Hi a general question,

Assuming a transmitter sending 32 bytes of data every 2mS, but a receiver that is only able to receive that data every 10mS due to the time needed to process that data . Then how can complete data be obtained.

A ISR could call much sooner than 10mS, and a buffer could be used, however there is never any downtime and so the buffer can never be large enough. Is there any way around this problem?
Thanks

回帖(4)

李天竹

2019-1-23 12:25:19
用更好的代码或更快的芯片来减少处理数据所需的时间。

以上来自于百度翻译


      以下为原文

    Decrease the time needed to process data, either with better code or with faster chip.
举报

王焕树

2019-1-23 12:37:36
如果你不能加速接收器代码,那么缓冲所有输入的数据,扔掉你没有时间处理的东西(假设你不能简单地减慢发射机的速度)。

以上来自于百度翻译


      以下为原文

    and if you can't speed up the receiver code, then buffer all the incoming data, and throw away what you don't have time to handle.
(This assumes you can't simply slow down the transmitter.)
 
举报

李涛

2019-1-23 12:53:22
你可以检查忙碌/等待IRQ或者RX在准备好的时候发送一个数据库。当RX将一个状态发送回TX时,这些数据将永远是过时的,这可能包括数据。我向RX发送大数据包(32字节,可能是100个或更多),并且它们都很好地工作,没有任何丢失。RX作为无线UART,然后打印到UART)

以上来自于百度翻译


      以下为原文

    You can check for busy/wait irq or get rx to send a databyte when ready.
These will always be 1 receive out of date when rx transmits a status back to the tx which could include data.
 
I send big packets (>32 bytes, could be a 100 or more) to the rx and it all works fine without any dropouts.
(Using rx as wireless uart which then prints to a uart)
举报

李涛

2019-1-23 13:01:24
接受者进入睡眠,醒来,接收到缓冲器,打开一个LED进行ACK,进入睡眠状态,看门狗定时器唤醒RX将LED关闭并返回睡眠,LED逐渐熄灭。

以上来自于百度翻译


      以下为原文

    The receiver goes to sleep, wakes, receives to a buffer, turns on a led for ack., goes to sleep, watchdog timer wakes rx to turn led off and goes back to sleep, led fades out.
 
Also controls a stepper motor.
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分