307 of 318
ZBasic System Library 297 ZX Microcontroller Family &H22 WaitPinChangeC Pin change on Port C Pin change on Port C¹ &H23 WaitPinChangeD Pin change on Port D Pin change on Port D² 1 Bits 0-5 only. ²Bits 2-7 only. intNum Values for Pin Change Interrupts Value Built-in Constant Trigger – mega1281 Trigger – mega1280 &H20 WaitPinChangeA &H21 WaitPinChangeB Pin change on Port B Pin change on Port B &H22 WaitPinChangeC &H23 WaitPinChangeD &H24 WaitPinChangeE Change on Port Bit E.0¹ &H29 WaitPinChangeJ Pin change on Port J² &H2a WaitPinChangeK Pin change on Port K ¹Not available on the ZX-1281e. ²Bits 0-6 only. For each of the intNum values in the tables above, the mode parameter specifies pin change interrupt enable bits corresponding to each pin of the port. For example, if the mode value is &H21, a pin change interrupt will be generated if either bit 0 or bit 5 of the specified port changes state. Clearly, a mode value of zero is useless since no pin change interrupt can ever occur in that case. Pin Change Interrupts (ATxmega-based devices) For ZX models based on the ATxmega processors, a task may await a state change on one or more pins of an I/O port. Each port has two separate channels of pin-change detection, e.g. WaitPinChangeA0 and WaitPinChangeA1. The channel is specified using values intNum parameter shown in the table below. intNum Values for Pin Change Interrupts Value Built-in Constant Trigger Processors &H20 WaitPinChangeA0 Pin change on Port A, channel 0 xmega128A1, xmega32A4 &H21 WaitPinChangeA1 Pin change on Port A, channel 1 xmega128A1, xmega32A4 &H22 WaitPinChangeB0 Pin change on Port B, channel 0 xmega128A1, xmega32A4 &H23 WaitPinChangeB1 Pin change on Port B, channel 1 xmega128A1, xmega32A4 &H24 WaitPinChangeC0 Pin change on Port C, channel 0 xmega128A1, xmega32A4 &H25 WaitPinChangeC1 Pin change on Port C, channel 1 xmega128A1, xmega32A4 &H26 WaitPinChangeD0 Pin change on Port D, channel 0 xmega128A1, xmega32A4 &H27 WaitPinChangeD1 Pin change on Port D, channel 1 xmega128A1, xmega32A4 &H28 WaitPinChangeE0 Pin change on Port E, channel 0 xmega128A1, xmega32A4 &H29 WaitPinChangeE1 Pin change on Port E, channel 1 xmega128A1, xmega32A4 &H2a WaitPinChangeF0 Pin change on Port F, channel 0 xmega128A1 &H2b WaitPinChangeF1 Pin change on Port F, channel 1 xmega128A1 &H2c WaitPinChangeH0 Pin change on Port H, channel 0 xmega128A1 &H2d WaitPinChangeH1 Pin change on Port H, channel 1 xmega128A1 &H2e WaitPinChangeJ0 Pin change on Port J, channel 0 xmega128A1 &H2f WaitPinChangeJ1 Pin change on Port J, channel 1 xmega128A1 &H30 WaitPinChangeK0 Pin change on Port K, channel 0 xmega128A1 &H31 WaitPinChangeK1 Pin change on Port K, channel 1 xmega128A1 &H32 WaitPinChangeQ0 Pin change on Port Q, channel 0 xmega128A1 &H33 WaitPinChangeQ1 Pin change on Port Q, channel 1 xmega128A1 For each of the intNum values in the tables above, the mode parameter specifies pin change interrupt enable bits corresponding to each pin of the port. For example, if the mode value is &H21, a pin change interrupt will be generated if either bit 0 or bit 5 of the specified port changes state. Clearly, a mode value of zero is useless since no pin change interrupt can ever occur in that case.