20 of 318
ZBasic System Library 10 ZX Microcontroller Family Interrupt Service Routines For the native code devices (e.g. ZX-24n), a few interrupt service routines (ISRs) are always included in your program (e.g. for Com1 and the RTC) while others are included only if certain System Library routines are used in your program. In some cases, the additional ISRs that are included when a specific System Library routine is used depends on how the routine is invoked and what the compiler can deduce regarding which ISRs might be needed. For example, if OpenCom() is invoked one or more times but the compiler can determine that the Com1 is always the channel being used, no additional ISRs are included since the Com1 ISRs are always included. On the other hand, if the compiler cannot determine which channel is being opened in one or more cases, it includes the ISRs for all Com channels, both hardware- based and software-based channels. In the description of each System Library routine, information is given about the set of ISRs might be included in your program if you use that routine. This information is only important, of course, if you are also providing one or more ISRs in your code because conflicts may arise. (See the section entitled “Defining Interrupt Service Routines” in the ZBasic Language Reference Manual for more information on how this is done.) The table below gives an overview of which System Library routines may cause ISRs to be included atomatically in your program. The shaded entries represent ISRs that are always included. System Library Routines that May Load ISRs Routine mega644P mega328P mega128 ADCtoCom1() Timer1_CompA Timer1_CompA Timer1_CompA Com1toDAC() Timer1_CompA Timer1_CompA Timer1_CompA InputCapture() Timer1_Capt Timer1_Ovf Timer1_Capt Timer1_Ovf Timer1_Capt Timer1_Ovf Timer3_Capt Timer3_Ovf OpenCom() USART0_RX USART0_TX USART0_UDRE USART1_RX USART1_TX USART1_UDRE Timer2_CompA Timer2_CompA Timer2_CompA USART0_RX USART0_TX USART0_UDRE USART0_RX USART0_TX USART0_UDRE USART1_RX USART1_TX USART1_UDRE OpenX10() INT0 Timer0_CompB Timer0_CompB INT0 n/a OutputCapture() Timer1_CompB Timer1_CompB Timer1_CompB Timer1_CompC Timer3_CompB WaitForInterrupt() INT0 INT1 INT2 PCINT0 PCINT1 PCINT2 PCINT3 Analog_Comp INT0 INT1 PCINT0 PCINT1 PCINT2 Analog_Comp INT0 INT1 INT2 INT3 INT4 INT5 INT6 INT7 Analog_Comp