Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Slide 13 Slide 14 Slide 15 Slide 16 Slide 17 Slide 18 Slide 19 Slide 20 Slide 21 Slide 22 Slide 23 Product List
UART Interrupt

This is the Interrupt Service Routine (ISR) for the UART peripheral. Keep in mind that this is just a very high level routine for illustration purposes. Slide 10 showed the block diagram of the UART peripheral. An output of the module is the interrupt flag that is generated by the receive interrupt flag (RI0) or the transmit interrupt flag (TI0). In the ISR, it is necessary to check which condition caused the CPU to vector to the ISR and the example shown only executes the code based on which flag was set using the conditional statement. Each conditional statement tests the flag to see if it is set. If the condition is true, then the flag is cleared. The receive ISR pulls the data from the buffer so that it can be used by the application. The transmit side clears the flag. The application is generally responsible for placing the next byte to be transmitted into the transmit buffer (SBUF0).

PTM Published on: 2011-02-07