29.4.6.3 Wait for Software Trigger

The user can set either a ‘PTGCTRL 0b1011’ (edge-triggered) or ‘PTGCTRL 0b1010’ (level-triggered) command to wait for a software generated trigger. This trigger is generated by setting the PTGSWT bit (PTGCON[10]).

The ‘PTGCTRL 0b1011’ command is sensitive only to the PTGSWT bit transition from ‘0’ to ‘1’. This transition must occur during the command execution; otherwise, the command will continue to wait. The PTGSWT bit is automatically cleared by hardware on completion of the ‘PTGCTRL 0b1011’ command execution, initializing the bit for the next software trigger command.

Figure 29-7 explains the operation of the wait for an edge-based software trigger.

Figure 29-7. Operation of Wait for Edge-Based Software Trigger

The ‘PTGCTRL 0b1010’ command is sensitive to the level of the PTGSWT bit. This command waits until PTGSWT = 1. It will complete immediately if PTGSWT = 1 upon entry to the command. The PTGSWT bit is not automatically cleared by the ‘PTGCTRL 0b1010’ command. If desired, the PTGSWT bit can be cleared by the user application on completion of the ‘PTGCTRL 0b1010’ command execution. Figure 29-8 explains the operation of the wait for the level-based software trigger.

Figure 29-8. Operation of Wait for Level-Based Software Trigger

Using the ‘PTGCTRL 0b1010’ or ‘PTGCTRL 0b1011’ step commands halts execution of further commands until the PTGSWT bit is set, allowing the user to coordinate activity between the PTG module and the application software.