引用: 引用 17 楼 papapa123123 的回复:
如果收一个就产生中断 那芯片岂不是一直在中断么?
FCR 最低位 是个 0模式 或1模式选择的。 你要看看在模式0 或模式1下 FIFO怎么操作,根据你的手册。
FCR的最高位 这样子 你把FIFO Reset下,用0x87或0xc7
FCR的最低位是使能/禁止FIFO的。模式选择是FCR【3】——但是奇怪的是我这个两个模式我都试过了还是同样的结果。
6.7 Hardware/software and time-out interrupts
The interrupts are enabled by IER[0-3]. Care must be taken when handling these
interrupts. Following a reset, if Interrupt Enable Register (IER) bit 1 = 1, the
SC16C652 will issue a Transmit Holding Register interrupt. This interrupt must be
serviced prior to continuing operations. The LSR register provides the current
singular highest priority interrupt only. It could be noted that CTS and RTS interrupts
have lowest interrupt priority. A condition can exist where a higher priority interrupt
may mask the lower priority CTS/RTS interrupt(s). Only after servicing the higher
pending interrupt will the lower priority CTS/RTS interrupt(s) be re?ected in the status
register. Servicing the interrupt without investigating further interrupt conditions can
result in data errors.
When two interrupt conditions have the same priority, it is important to service these
interrupts correctly. Receive Data Ready and Receive Time Out have the same
interrupt priority (when enabled by IER[3]). The receiver issues an interrupt after the
number of characters have reached the programmed trigger level. In this case, the
SC16C652 FIFO may hold more characters than the programmed trigger level.
Following the removal of a data byte,
the user should re-check LSR[0] for additional
characters. A Receive Time Out will not occur if the receive FIFO is empty. The
time-out counter is reset at the center of each stop bit received or each time the
receive holding register (RHR) is read. The actual time-out value is 4 character time,
including data information length, start bit, parity bit, and the size of stop bit, i.e., 1×,
1.5×, or 2× bit times.