拟用AT91SAM7S256做一主机多从机式通讯,主机发送请求,从机应答。从机不主动发送应答信息。
由于信息帧的长度不一致,想用接收超时来实现变长信息帧的处理。
芯片手册上描述是这样的:
Stop the counter clock until a new character is received. This is performed by writing the
Control Register (US_CR) with the STTTO (Start Time-out) bit at 1. In this case, the idle state on RXD before a new character is received will not provide a time-out. This prevents having to handle an interrupt before a character is received and allows waiting for the next idle state on RXD after a frame is received.
我在开发板上测试,发现信息接收完毕PDC已经产生中断了,Timeout位仍然置1了。也就是说通讯超时还是发生了。
是不是只要开始接收字符,timeout计数器就不会停下来,即便是一个信息帧已经结束,除非手动复位? |