Hi,
I am trying to program a multi stepper motor control program using a single PIC microcontroller. My idea is to use stepper motor controller to control the stepper motor with the step input from the PIC microcontroller. The microcontroller will also connect to some other periperals and check their status and respond to control the motors in real time. I am using MicroCode Studio and PicBasic Pro.
My idea about the program flow is like this:
When the program starts, the microcontroller will be in a main loop to check the status of the peripherals. When a signal coming in, the microcontroller will start the stepper motors as instructed. I will use "For... Next" loop and "Pulsout" to generate the step input for the stepper motors. But now the problem comes: while the microcontroller is generating the "For... Next" loop and "Pulsout" for the pulse width generation, it won't go back to the main loop to check the status of the peripherals, so if another signal coming in from the peripherals at this time, the microcontroller will not detect it.
My question is: is there any way that I can programm the micro controller to send the step out in parallel with the main loop so that the main loop will keep tracking the signals from the peripherals all the time? Any help will be highly appreciated! Thanks a lot in advance!
Sean
Bookmarks