Hi,
Pulse accumulator can be set to the Event counter mode which allows incrementing the PACNT by a count each time there is pulse on IOC7 pin (falling/rising edge; see Table 14-17. PACTL Field Descriptions in the S12P RM).
So you can use this to read and store the PACNT value and then compare it with desired one.
An other solution could be IRQ input pin. If the frequency of pulses on the input pin is not so high, you can use simple code to count the number of pulses on the input.
Define global variable and give it a value of pulse number you expect e.g. i=127;
Then define the IRQ interrupt routine which is called each time there is a pulse on the IRQ pin.
In the IRQ_ISR, you should compare and decrement the 'i' value (i<1, --i) and do this until it reaches zero. And here you should do what you want.
I've tested this on S12P demo board and it works fine. The SW sample code will be posted soon.
Actually, this solution can be implemented on IOC7 with PAIF.
Btw, your last question is not so clear. PT7 is the port which can be used as GPIO. But timer if enabled has higher priority over GPIO function.
Regards,
Ivan