PWM need to be finished before jumping to the next instruction. If you can deal with it, that great, unless you may need to use a Timer interrupt to produce your PWM or switch to the 12F683 which have a built-in PWM module.
Multitasking will be more than likely time slicing process, but fast enough to looks like multitasking. Once again Timer interrupts are pretty handy.
You can have a periodic timer interrupt and increase/decrease some variables in. Once you reach x value, then you enable/disable your i/os in the main program or in the ISR. But i usually prefer to do it in the mainloop when possible, keeping the ISR as short as possible.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks