It depends on the hardware, and the best answer is to give it a chance and try it.
Your other options are to either use a separate PIC to control the stepping mechanism, as you mentioned, use pseudo-threading (a custom thread, but usually not available in most compilers for the PIC platform).
But perhaps what works best for you is that the main loop of your software controls the stepper motor (for ... moving, sleeping, continuing), and then use interrupts to process the TCP / IP requests that come in which You will change the status registers / variables.
Using interrupts is a good idea, but when you have something so high priority, polls and loops are the best options. In order for everything to go smoothly, you must be able to ensure that your TCP / IP interrupts do not exceed xxx cycles (or milliseconds, the same on the PIC, really), or add step control code to the TCP / IP interrupt.
Now none of this is required if your PIC has interrupt priorities. In this case, just place the stepper device interrupt with a higher priority than the TCP interrupt, and you will be good to go. However, I do not think PIC has user functions, but I could be wrong. It might also be a good idea to switch to another platform that supports priority interrupts because it will make much cleaner code and simplify your life in general.
source share