Hello, and welcome to the forum.
How do you intend to wake up from STOP3 mode? For other than an external reset, the alternatives would appear to be the RTI module, external interrupt pin, or the KBI module. One of these methods will need to generate an interrupt to provide stop mode exit, and this will need to be enabled prior to entering stop mode.
Stop mode is entered by incorporating the STOP instruction within the main loop, at the point where you wish to start this mode. For a C program, you would use __asm stop;
When the wake-up source becomes active, the associated ISR code would first be executed, and then the main loop code will resume at the next instruction after the stop instruction.
Regards,
Mac