![Texas Instruments AM1808 Скачать руководство пользователя страница 1239](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581239.webp)
Architecture
1239
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Multichannel Buffered Serial Port (McBSP)
25.2.13 Interrupt Support
The McBSP can send both receive and transmit interrupts.
25.2.13.1 Interrupt Events and Requests
The RRDY and XRDY bits in the serial port control register (SPCR) indicate the ready state of the McBSP
receiver and transmitter, respectively. Writes and reads from the serial port can be synchronized by any of
the following methods:
•
Polling RRDY and XRDY bits in SPCR
•
Using the events sent to the EDMA controller (REVT and XEVT)
•
Using the interrupts to the CPU (RINT and XINT) that the events generate
Reading DRR and writing to DXR affects RRDY and XRDY, respectively.
25.2.13.1.1 Interrupt Events: RINT and XINT
The receive interrupt (RINT) and transmit interrupt (XINT) signals inform the CPU of changes to the serial
port status. Three options exist for configuring these interrupts. These options are set by the
receive/transmit interrupt mode bits (RINTM and XINTM) in SPCR. The possible values of the mode, and
the configurations they represent, are:
•
(R/X)INTM = 00b: Interrupt on every serial element by tracking the (R/X)RDY bits in SPCR.
•
(R/X)INTM = 01b: Interrupt at the end of a subframe (16 elements or less) within a frame. See
for more details.
•
(R/X)INTM = 10b: Interrupt on detection of frame synchronization pulses. The associated portion
(receiver/transmitter) of the McBSP must be out of reset.
•
(R/X)INTM = 11b: Interrupt on frame synchronization error. Note that if any of the other interrupt modes
are selected, (R/X)SYNCERR may be read when servicing the interrupts to detect this condition. See
and
for more details on synchronization error.
25.2.13.1.2 Receive Ready Status: RINT and RRDY
RRDY = 1 indicates that the RBR contents have been copied to DRR and that the data can now be read
by either the CPU or the EDMA controller. Once that data has been read by either the CPU, RRDY is
cleared to 0. Also, at device reset or serial port receiver reset (RRST = 0), the RRDY bit is cleared to 0 to
indicate that no data has been received and loaded into DRR. RRDY directly drives the McBSP receive
interrupt (RINT) to the CPU if RINTM = 00b (default value) in SPCR.
25.2.13.1.3 Transmit Ready Status: XINT and XRDY
XRDY = 1 indicates that the DXR contents have been copied to XSR and that DXR is ready to be loaded
with a new data word. When the transmitter transitions from reset to non-reset (XRST transitions from 0 to
1), XRDY also transitions from 0 to 1 indicating that DXR is ready for new data. Once new data is loaded
by the CPU, the XRDY bit is cleared to 0. However, once this data is copied from DXR to XSR, the XRDY
bit transitions again from 0 to 1. The CPU can write to DXR although XSR has not yet been shifted out on
DX. XRDY directly drives the McBSP transmit interrupt (XINT) to the CPU if XINTM = 00b (default value)
in SPCR.
NOTE:
If the polling method is used to service the transmitter, the CPU should wait for one McBSP
bit clock (CLKX) before polling again to write the next element in DXR. This is because
XRDY transitions occur based on bit clock and not CPU clock. The CPU clock is much faster
and can cause false XRDY status, leading to data errors due to overwrites.