Microchip Technology MA330031-2 Data Sheet

Page of 530
dsPIC33EPXXXGP50X, dsPIC33EPXXXMC20X/50X AND PIC24EPXXXGP/MC20X
DS70000657H-page 350
 2011-2013 Microchip Technology Inc.
24.4
Step Commands and Format
TABLE 24-1:
PTG STEP COMMAND FORMAT 
Step Command Byte:
STEPx<7:0>
CMD<3:0>
OPTION<3:0>
bit 7
bit 4 bit 3
bit 0
bit 7-4
CMD<3:0>
Step 
Command
Command Description
0000
PTGCTRL
Execute control command as described by OPTION<3:0>.
0001
PTGADD
Add contents of PTGADJ register to target register as described by 
OPTION<3:0>.
PTGCOPY
Copy contents of PTGHOLD register to target register as described by 
OPTION<3:0>.
001x
PTGSTRB
Copy the value contained in CMD<0>:OPTION<3:0> to the CH0SA<4:0> bits 
(AD1CHS0<4:0>).
0100
PTGWHI
Wait for a low-to-high edge input from the selected PTG trigger input as 
described by OPTION<3:0>.
0101
PTGWLO
Wait for a high-to-low edge input from the selected PTG trigger input as 
described by OPTION<3:0>.
0110
Reserved
Reserved.
0111
PTGIRQ
Generate individual interrupt request as described by OPTION3<:0>.
100x
PTGTRIG
Generate individual trigger output as described by <<CMD<0>:OPTION<3:0>>.
101x
PTGJMP
Copy the value indicated in <<CMD<0>:OPTION<3:0>> to the Queue Pointer 
(PTGQPTR) and jump to that Step queue.
110x
PTGJMPC0
PTGC0 = PTGC0LIM: Increment the Queue Pointer (PTGQPTR).
PTGC0 
 PTGC0LIM: Increment Counter 0 (PTGC0) and copy the value 
indicated in <<CMD<0>:OPTION<3:0>> to the Queue Pointer (PTGQPTR), 
and jump to that Step queue
111x
PTGJMPC1
PTGC1 = PTGC1LIM: Increment the Queue Pointer (PTGQPTR).
PTGC1 
 PTGC1LIM: Increment Counter 1 (PTGC1) and copy the value 
indicated in <<CMD<0>:OPTION<3:0>> to the Queue Pointer (PTGQPTR), 
and jump to that Step queue.
Note 1:
All reserved commands or options will execute but have no effect (i.e., execute as a NOP instruction).
2:
Refer to 
 for the trigger output descriptions.
3:
This feature is only available on dsPIC33EPXXXMC20X/50X and PIC24EPXXXMC20X devices.