Implementing a loop micro-code command by writing directly to the control memory (GX5050/GC5050/GT2550)

Knowledge Base Article # Q200051

Summary Implementing a micro-code that execute the same steps three times (LOOP command) and then HALT for GC5050, GX5050 or GT2550 boards.
Solution:

The following table shows the control memory content in order to create the sequence of loop three times and then Halt.

Note: All 32 channels direction are set to OUT, i.e. bits 28-31 are low.

When writing commands to the control memory all commands need to be spread on four consecutive steps.
Step #Control Memory value
00x00000002
10x00000002
20x00000002
30x00000002
40x00000000
50x00000000
60x00000000
70x00000004
80x00000004
90x00000004
100x00000004
110x00000000
120x000E0000
130x000E0000
140x000E0000
150x01CE0000

Steps 0-3:
Command Sets register A equal to 2 with no conditions in order to loop a total of 3 times we set register A to 2.
The first three steps (0 through 2) hold the Register value (bits 0 through 15). The fourth consecutive step (3)
has the register number (bits 20-21) ORed with the Loop address value.

Steps 4-6:
Command No Operation

Steps 7-11:
Command: Loop on A. Loop steps 4 through 10 the number of times register A is set to.
The first three steps (7 through 9) hold the Loop address value (bits 0 through 16 for a total of 128K).
The fourth consecutive step (10) holds the Operation Code (bits 22 through 24) ORed with the Loop address value.

Step 11:
Command No Operation

Steps 7-11:
Command: Halt. The first three steps (12 through 14) hold the Halt command condition value (bits 17-19).
The fourth consecutive step (15) holds the Operation Code, bits 22 through 24 ORed with Halt command condition value.

Loop command flow chart:

Note: The value of register A at the end of a Loop command is 65535 (0xFFFF).
Article Date 4/17/2003 5:05:29 PM
Keywords GC5050, GX5050, GT2550, LOOP command, micro-code, control memory
 0 ratings | 0 out of 5