
Programmable Four-Channel Communications Controller
—
CD2481
Datasheet
59
When a receive error occurs, the device stops DMA at the point of error and generates a bus error
receive exception interrupt. RISR indicates the cause of the exception, and RCBADR provides the
next location in the receive buffer.
The CPU has the following five options:
1. Terminate the buffer.
2. Discard the exception.
3. Terminate the buffer and discard the exception.
4. Continue from the current position in the buffer.
5. Leave
‘
n
’
byte gap in the buffer and then continue.
The required option is written to the REOIR (Receive End-of-Interrupt register) by the CPU to
terminate the interrupt. If the terminate buffer option is chosen, the 2481OWN bit in the A/
BRBSTS register should first be cleared by the CPU, or a new buffer can be supplied by the CPU.
5.4.7.7
Receive Time-Out in Asynchronous DMA Mode
In Asynchronous DMA mode, the only way that the CD2481 releases the ownership is reaching the
end-of-buffer. Receive time-out or any exceptions do not release the ownership if end-of-buffer
condition is not met. The following illustrates recommended procedures to handle receive time-out
in Asynchronous DMA mode.
Scenario 1:
Buffer A is currently selected, receive time-out occurs, host wants to continue on.
Recommendation:
Do nothing in the receive time-out interrupt service routine.
Scenario 2:
Buffer A is currently selected, receive time-out occurs, host does not require DMA
anymore.
Recommendation:
Reset ownership bits in A(B) RBSTS, and set TermBuff in REOIR in the
receive time-out interrupt service routine.
Scenario 3:
Buffer A is currently used, receive time-out occurs, host wants to start DMA in buffer
B.
Recommendation:
Set TermBuff in REOIR in the receive time-out interrupt service routine. The
CD2481 switches to buffer B.
Note:
When a receive time-out occurs in buffer B, the CD2481 pops back to buffer A, unless the host
clears both Ownership Status bits.
The above scenarios apply if buffer B is selected first.
5.4.7.8
Receive Bus Errors
When a receive bus error interrupt is generated, the RISR and A/BRBSTS registers both indicate a
bus error status. The current transfer address is available in the RCBADR[0
–
3] registers, the bus
error occurred on the last transfer that started at this address. This means that the actual error
address can be up to 16 bytes further on in the buffer.
Following a bus-error condition, the CPU has the choice of either discontinuing the current buffer,
or retrying from the start of the last transfer. If the buffer is to be discontinued, the number of valid
receive bytes can be calculated by subtracting the starting address A/BRBADR[0
–
3] from the
current address RCBADR[0
–
3]. The CPU should set the TermBuff bit in REOIR to terminate this
buffer and move to the next.