169 of 307
ZBasic System Library 159 ZX Microcontroller Family It is important to note that on the ZX-24p and ZX-24n, the Com2 serial channel cannot be used at the same time as the hardware I2C channel because the pin 11 is shared between the TxD pin of Com2 and the SDA signal. Com3 to Com6 are implemented as software UARTs 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-24pe, ZX-24ne Timer2 ZX-24p, ZX40p, ZX-44p, ZX-24n, ZX-40n, ZX-44n 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-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 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 Note, particularly, that the ISRs for Com1 are always included in every program even if OpenCom() is not explicitly invoked. Compatibility In BasicX, the supported channel numbers are 1 to 3, depending on the particular target chip. Also, BasicX doesn’t support the use of zero to indicate no queue is being supplied. See Also ComChannels, CloseCom, DefineCom, StatusCom