104 of 172
ZBasic Language Reference 97 ZX Microcontroller Family TIMER1_CAPT 5 TIMER1_CAPT 5 TIMER1_CAPT 5 TIMER1_CAPT 5 TIMER1_CAPT 5 TIMER1_COMPA 6 TIMER1_COMPA 6 TIMER1_COMPA 6 TIMER1_COMPA TIMER1_COMPA TIMER1_COMPB 7 TIMER1_COMPB 7 TIMER1_COMPB 7 TIMER1_COMPB 7 TIMER1_COMPB 7 TIMER1_COMPC 7 TIMER1_COMPC 7 TIMER1_COMPC 7 TIMER1_OVF 5 TIMER1_OVF 5 TIMER1_OVF 5 TIMER1_OVF 5 TIMER1_OVF 5 TIMER2_COMPA³ TIMER2_COMPA³ TIMER2_COMPA³ TIMER2_COMPA² TIMER2_COMPA² TIMER2_COMPB TIMER2_COMPB TIMER2_COMPB TIMER2_COMPB 4 TIMER2_COMPB 4 TIMER2_OVF TIMER2_OVF TIMER2_OVF TIMER2_OVF TIMER2_OVF TIMER3_CAPT 5 TIMER3_CAPT 5 TIMER3_CAPT 5 TIMER3_COMPA TIMER3_COMPA TIMER3_COMPA TIMER3_COMPB 7 TIMER3_COMPB 7 TIMER3_COMPB 7 TIMER3_COMPC TIMER3_COMPC TIMER3_COMPC TIMER3_OVF 5 TIMER3_OVF 5 TIMER3_OVF 5 TIMER4_CAPT 5 TIMER4_COMPA 6 TIMER4_COMPA 6 TIMER4_COMPB TIMER4_COMPB 7 TIMER4_COMPC TIMER4_COMPC TIMER4_OVF TIMER4_OVF 5 TIMER5_CAPT 5 TIMER5_COMPA TIMER5_COMPA TIMER5_COMPB TIMER5_COMPB 7 TIMER5_COMPC TIMER5_COMPC TIMER5_OVF TIMER5_OVF 5 TWI or I2C TWI or I2C TWI or I2C TWI or I2C TWI or I2C USART0_RX 8 USART0_RX 8 USART0_RX 8 USART0_RX 9, 10 USART0_RX 8 USART0_TX 8 USART0_TX 8 USART0_TX 8 USART0_TX 9, 10 USART0_TX 8 USART0_UDRE 8 USART0_UDRE 8 USART0_UDRE 8 USART0_UDRE 9, 10 USART0_UDRE 8 USART1_RX 9 USART1_RX 9 USART1_RX 8, 10 USART1_RX 9 USART1_TX 9 USART1_TX 9 USART1_TX 8, 10 USART1_TX 9 USART1_UDRE 9 USART1_UDRE 9 USART1_UDRE 8, 10 USART1_UDRE 9 USART2_RX 9 USART2_TX 9 USART2_UDRE 9 USART3_RX 9 USART3_TX 9 USART3_UDRE 9 WDT WDT WDT WDT 1 Used by WaitForInterrupt(). 2 Used by the RTC, cannot be replaced. 3 Used by OpenCom() for channels 3-6 (software UART). 4 Used by OpenX10() along with INT0. 5 Used by InputCapture(). 6 Used by ComToDAC() and DACToCom1(). 7 Used by OutputCapture(). 8 Used by Com1, cannot be replaced. 9 Used by OpenCom() for channels 2 (and 7 or 8 where supported). 10 For the ZX-1281e and ZX-1281ne, the roles of USART0 and USART1 are reversed. For the form of ISR definition shown in the example above, the compiler takes care of saving the necessary registers upon entry, establishing the standard register state, restoring registers upon exit and executing a “return from interrupt” instruction. For special cases, you may define a “naked” ISR – one in which none of this is done. Using this special form is advised only for advanced programmers, particularly those that understand the nuances of the underlying code. An example of a naked ISR containing only a “return from interrupt” is shown below. This is commonly called a “stub” ISR. It is important to note that defining a naked ISR with no code statements in it at all