ZBasic System Library
168
ZX Microcontroller Family
The software-based serial channels are implemented using the Serial Timer (see table below) to regulate
the bit timing. When one or more of the channels 3-6 are open the corresponding timer busy flag will be
True indicating that Serial Timer is in use. When all of the channels 3-6 are closed, corresponding timer
busy flag will again be False indicating that the Serial Timer is available for other uses.
Serial Timer by Device
ZX Model
Serial Timer
ZX-24, ZX40, ZX-44, ZX-24e
Timer2
ZX-24a, ZX40a, ZX-44a, ZX-24ae, ZX-24ne, ZX-24pe, ZX-24nu, ZX-24pu
Timer2
ZX-24p, ZX40p, ZX-44p, ZX-24n, ZX-40n, ZX-44n
Timer2
ZX-24r, ZX40r, ZX-44r, ZX-24s, ZX-40s, ZX-44s, ZX-24ru, ZX-24su
Timer2
ZX-328n, ZX-328l, ZX-32n, ZX-32l, ZX-328nu
Timer2
ZX-1281, ZX-1281n, ZX-1280, ZX-1280n, ZX-1281e, ZX-1281ne
Timer0
ZX-24x, ZX-32a4, ZX-128a1, ZX-24xu
TimerD1
ZX-128e, ZX-128ne
Timer2
For native code devices, the table below indicates which ISRs may be loaded by using OpenCom() in
your program. If the compiler cannot determine which specific channel is being opened, all of the listed
ISRs will be included.
ISRs Required
Underlying CPU
Com Channel
ISR Name
mega644P,
mega1284P
Com1
Com2
Com3-Com6
USART0_RX, USART0_TX, USART0_UDRE
USART1_RX, USART1_TX, USART1_UDRE
Timer2_CompA
mega328P
Com1
Com3-Com6
USART0_RX, USART0_TX, USART0_UDRE
Timer2_CompA
mega128
Com1
Com2
Com3-Com6
USART0_RX, USART0_TX, USART0_UDRE
USART1_RX, USART1_TX, USART1_UDRE
Timer2_CompA
mega1281
Com1
Com2
Com3-Com6
USART1_RX, USART1_TX, USART1_UDRE
USART0_RX, USART0_TX, USART0_UDRE
Timer0_CompA
mega1280
Com1
Com2
Com3-Com6
Com7
Com8
USART0_RX, USART0_TX, USART0_UDRE
USART1_RX, USART1_TX, USART1_UDRE
Timer0_CompA
USART2_RX, USART2_TX, USART2_UDRE
USART3_RX, USART3_TX, USART3_UDRE
xmega32A4
Com1
Com2
Com3-Com6
Com7
Com8
Com9
USARTD0_RXC, USARTD0_TXC, USARTD0_DRE
USARTD1_RXC, USARTD1_TXC, USARTD1_DRE
TimerD1_CCA
USARTC0_RXC, USARTC0_TXC, USARTD0_DRE
USARTC1_RXC, USARTC1_TXC, USARTD1_DRE
USARTE0_RXC, USARTE0_TXC, USARTE0_DRE
xmega128A1
Com1
Com2
Com3-Com6
Com7
Com8
Com9
Com10
Com11
Com12
USARTD0_RXC, USARTD0_TXC, USARTD0_DRE
USARTD1_RXC, USARTD1_TXC, USARTD1_DRE
TimerD1_CCA
USARTC0_RXC, USARTC0_TXC, USARTD0_DRE
USARTC1_RXC, USARTC1_TXC, USARTD1_DRE
USARTE0_RXC, USARTE0_TXC, USARTE0_DRE
USARTE1_RXC, USARTE1_TXC, USARTE1_DRE
USARTF0_RXC, USARTF0_TXC, USARTF0_DRE
USARTF1_RXC, USARTF1_TXC, USARTF1_DRE
Note, particularly, that the ISRs for Com1 are always included in every program even if OpenCom() is not
explicitly invoked.