Step Command Format
There are eleven 8-bit Step commands available to the Peripheral Trigger Generator (PTG). Each of the Step commands has two fields:
- CMD<3:0>: 4-bit description of the operation to be performed
- OPTION<3:0>: parameter that clarifies either the source or destination operand
Executing Step Commands
Step commands are executed from the PTG's queue. The commands are placed into the queue by the application program. This queue is typically programmed during the application's start-up process rather than the main loop. Depending upon which MCU is being used, between eight and 32 Step commands can be programmed into the queue.
Once the queue is programmed the application will enable (PTGEN=1), then start (PTGSTRT=1) the PTG. The Step Queue Pointer Register (PTGQPTR) acts as a program counter controlling access to the PTG Step commands. When the PTG is enabled, PTGQPTR points to the first entry in the queue. The PTG sequentially decodes and executes instructions, incrementing PTGQPTR as each Step command is executed. Using the Jump Step commands, PTGQPTR can be altered to control program flow.