| Electronic Components Datasheet Search |
|
AM8530 Datasheet(PDF) 163 Page - Advanced Micro Devices |
|
|
|||||||||||||||||||||||||||||
AM8530 Datasheet(HTML) 163 Page - Advanced Micro Devices |
|
163 / 194 page ![]() SCC Application Notes AMD 7–14 7.3.4 Interrupt Routine When the SCC has been initialized and enabled, it is ready for communication. The trans- mitter buffer and the receive FIFO are both empty. An interrupt will not be generated until the software writes the first character to the transmit buffer. Once the first character is in the SCC shift register, the first transmit interrupt will occur. The SCC then continues to issue interrupts to the interrupt controller until the end of the message. At the end of the message, a Reset Transmitter Interrupt Pending (WR0) is issued to clear the transmit interrupt. After the last character is read into the SCC, the interrupts will cease until an- other message is written into the transmitter. Once an interrupt is received and the interrupt controller vectors to the interrupt routine, RR2 is read from channel B. The value read from RR2 is the vector, including status. This vector shows the status of the highest priority interrupt pending (IP) at the time it is read. Once the highest priority interrupt condition is cleared, RR2 will show the status of the next highest interrupt pending, if one is present. This allows multiple interrupts to be serv- iced without the overhead of the interrupt acknowledge cycle of the interrupt controller. MIE is disabled and then enabled to guarantee an edge for an edge-sensitive interrupt controller. The following example shows how the interrupt routine should be coded. BEGIN: INPUT RR2 ;Read RR2 from channel B TEST Bit 4 ;Test for Tx Empty JE TXEMPTY ;Jump to Transmit Routine TEST Bit 5 ;Test for Rx full JUMP RXFULL ;Jump to Receive Routine OUT WR9 00 ;MIE Disabled OUT EOI ;Output EOI to Interrupt Controller IRET ;Return to Main ; ; TXEMPTY: TEST NOMORE ;Test a last character flag JE LAST ;Jump to LAST if no more characters OUTPUT CHAR ;Output character to data port DEC CHARCOUNT ;Decrement character count JUMP BEGIN ;Jump to BEGIN to test for more IP ; LAST: OUTPUT RR0,28H ;Reset Tx Interrupt Pending JUMP BEGIN ;Jump to BEGIN to test for more IP ; ; RXFULL: INPUT RR1 ;Read RR1 COMPARE RR1,00 ;Test for special condition bit set JUMP NE ;Jump to SPECIAL INPUT CHAR ;Input charcater from data port JUMP BEGIN ;Jump to BEGIN to test for more IP ; SPECIAL; . . This means a framing error, receive overrun error or parity error has occurred. Character may be read but data is not correct. A flag should be set to post the error. . . OUTPUT RR0, 30H ;Reset Error Command JUMP BEGIN ;Jump to BEGIN to test for more IP Figure 7–5. SCC Interrupt Routine |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |