![]() ZBasic System Library
11
ZBasic Microcontrollers
ISRs Required for Serial Channels
Target CPU
Com Channel
ISR Name
tiny87, tiny167
Com1
Com3-Com6
LIN_TC
Timer0_CompA
tiny2313, tiny2313A,
tiny4313, tiny828, tiny441,
tiny841, tiny1634
Com1, Com2
Com3-Com6
USART#_RX, USART#_TX, USART#_UDRE
Timer0_CompA
all other ATtiny
Com3-Com6
Timer*_CompA
all ATmega
Com1, Com2, Com7, Com8
Com3-Com6
USART#_RX, USART#_TX, USART#_UDRE
Timer*_CompA
all ATxmega
Com1, Com2, Com7-Com12
Com3-Com6
USART#_RXC, USART#_TXC, USART#_DRE
Timer*_CCA
Note, particularly, that if the console (typically Com1) is implicitly opened for an application, the ISRs for
the console channel will be included in the application even if OpenCom() is not explicitly invoked. The
console channel is implicitly opened by default for all ZX devices but not so for generic target devices.
ZBasic devices generally have multiple timers, depending on the underlying CPU type, that are used for
various purposes. One of the timers is (optionally) used to implement the real time clock (RTC), another
is used for the software-based serial ports and a third timer is used to provide the precise timing required
for certain I/O routines. The specific timer that is used for a particular function varies depending on the
underlying CPU type as shown in the table below.
Timer Usage by Target Device
Target Device
RTC
Timer
I/O
Timer
Serial
Timer
PWM8
Timer
PWM 16
Timer
Input
Capt.
Output
Capt.
tiny24, tiny24A, tiny44, tiny44A, tiny84, tiny84A
Timer0
Timer1
Timer0
Timer0
Timer1
Timer1
Timer1
tiny48, tiny88
Timer0
Timer1
Timer0
-
Timer1
Timer1
Timer1
tiny87, tiny167, tiny2313, tiny2313A, tiny4313,
tiny828, tiny1634
Timer0
Timer1
Timer0
Timer0
Timer1
Timer1
Timer1
tiny441, tiny841
Timer0
Timer1
Timer0
Timer0
Timer1
Timer2
Timer1
Timer2
Timer1
Timer2
mega8, mega8A
Timer2
Timer1
Timer2
Timer2
Timer1
Timer1
Timer1
mega48, mega48A, mega48P, mega48PA,
mega48PB, mega88, mega88A, mega88P,
mega88PA, mega88PB, mega168, mega168A,
mega168P, mega168PA, mega168PB,
mega328, mega328P, mega328PB
Timer0
Timer1
Timer2
Timer2
Timer1
Timer1
Timer1
mega16, mega16A, mega164A, mega164P,
mega164PA, mega32, mega32A, mega324P,
mega324PA, mega644, mega644A,
mega644P, mega644PA, mega8535
Timer0
Timer1
Timer2
Timer2
Timer1
Timer1
Timer1
mega1284P
Timer0
Timer3
Timer2
Timer2
Timer1
Timer3
Timer1
Timer3
Timer1
Timer3
mega8515
Timer0
Timer1
Timer0
Timer0
Timer1
Timer1
Timer1
mega161
Timer0
Timer1
Timer2
Timer2
-
Timer1
Timer1
mega162
Timer0
Timer3
Timer2
Timer2
Timer1
Timer3
Timer1
Timer3
Timer1
Timer3
mega163
Timer2
Timer1
Timer2
Timer2
-
Timer1
Timer1
mega323
Timer0
Timer1
Timer2
Timer2
-
Timer1
Timer1
mega165, mega165A, mega165P,
mega165PA, mega325, mega325P,
mega645, mega645A, mega645P,
mega169, mega169A, mega169P,
mega169PA, mega329, mega329P,
Timer0
Timer1
Timer2
Timer2
Timer1
Timer1
Timer1
|