English
Language : 

45111 Datasheet, PDF (103/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
10 SX Special Features and Coding Tips
The following are points to remember with Wake-Up Interrupts:
• The interrupt routine must be located starting at address $0 in the SX program.
• The interrupt routine should take a maximum of 6 cycles less than the desired cycle time slot. (i.e. if
the interrupt should execute once every 20 cycles, it needs to be less than 15 cycles in size).
• The SX chip will activate the interrupt routine exactly 3 clock cycles (Turbo) or 8 clock cycles
(Compatible) after an RTCC rollover event occurs. This deterministic feature allows for jitter-free
interrupt response.
An RTCC rollover interrupt event will not occur during SLEEP mode and thus can not wake up the SX
chip from a SLEEP mode.
10.5 Creating Tables
10.5.1 Data Tables
Tables of 8-bit or 12-bit data may be stored in the unused program space of the SX chip. Tables of data
may be necessary in cases where a set of data can not be calculated by an equation, or will take too long
to calculate. There are two methods available to store data tables in the SX chip.
If only 8-bit data is required, the RETW method may be used to create the data table. This method uses
a set of RETW commands which each hold an 8-bit data value as their operand. The table is preceded by
a JMP PC+W command. By moving an index value to W and then CALLing the first line of the table,
which is the JMP command, W is added to the program counter and upon the next clock cycle, the
proper RETW command is executed. RETW simply moves its operand to W and then returns to the line
after the CALL.
To create an 8-bit data table with the RETW command:
1) Set the table’s location, and insert a label and a JMP PC+W command at the start of the table.
2) Add as many RETW commands as necessary.
3) When data is needed from the table, move the index value of the desired item to W and CALL the
table. Upon returning, the 8-bit value is in W.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 103