Discussion forum for the BasicX family of microcontroller chips.
|
Dear guys, I never worked with BX-24 HW interrupts before and have not found a clear explanation in BX docs of how it work. The "Counting pulses with hw interrupt" example is unfortunately single-task and it is not clear how that will affect the multi-task setup. My two questions are: 1. If I have two tasks - one is a PID temperature controller that has to run all the time and another task runs rarely and should only start if I press a button momentarily. If I issue a WaitForInterrupt command from the second task, will it stop the first one and just sit and wait for the interrupt (pin 11, right?) or will it allow the first task to run while waiting for an interrupt? 2. Is it really worth it to play with interrupts as opposed to just having a small task that polls the pin? Thanks a million. Alex. |
|
|
|
the whait for interupt wil only stop the task that it is in. it will not delay the others. I do use it. --- Alex Chaihorsky <> wrote: > Dear guys, > > I never worked with BX-24 HW interrupts before and have not found a > clear explanation in BX docs of how it work. The "Counting pulses > with hw interrupt" example is unfortunately single-task and it is not > clear how that will affect the multi-task setup. > > My two questions are: > 1. If I have two tasks - one is a PID temperature controller that has > to run all the time and another task runs rarely and should only > start if I press a button momentarily. > > If I issue a WaitForInterrupt command from the second task, will it > stop the first one and just sit and wait for the interrupt (pin 11, > right?) or will it allow the first task to run while waiting for an > interrupt? > > 2. Is it really worth it to play with interrupts as opposed to just > having a small task that polls the pin? > > Thanks a million. > > Alex. > > __________________________________________________ |
|
|
|
Thanks, Tony - Do I have to worry about any interference between the interrupt stuff with say PWM or Com1 stuff? Thanks a lot. AC. --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > the whait for interupt wil only stop the task that it is in. > it will not delay the others. > > I do use it. > > --- Alex Chaihorsky <alex_chaihorsky@h...> wrote: > > Dear guys, > > > > I never worked with BX-24 HW interrupts before and have not found a > > clear explanation in BX docs of how it work. The "Counting pulses > > with hw interrupt" example is unfortunately single-task and it is not > > clear how that will affect the multi-task setup. > > > > My two questions are: > > 1. If I have two tasks - one is a PID temperature controller that has > > to run all the time and another task runs rarely and should only > > start if I press a button momentarily. > > > > If I issue a WaitForInterrupt command from the second task, will it > > stop the first one and just sit and wait for the interrupt (pin 11, > > right?) or will it allow the first task to run while waiting for an > > interrupt? > > > > 2. Is it really worth it to play with interrupts as opposed to just > > having a small task that polls the pin? > > > > Thanks a million. > > > > Alex. > > > > > > > > > > > > > > > > > > __________________________________________________ |
|
|
|
no worry if those are on another task. --- Alex Chaihorsky <> wrote: > Thanks, Tony - > > Do I have to worry about any interference between the interrupt stuff > with say PWM or Com1 stuff? > > Thanks a lot. > > AC. > --- In basicx@y..., Tony Brenke <trbrenke@y...> wrote: > > the whait for interupt wil only stop the task that it is in. > > it will not delay the others. > > > > I do use it. > > > > --- Alex Chaihorsky <alex_chaihorsky@h...> wrote: > > > Dear guys, > > > > > > I never worked with BX-24 HW interrupts before and have not found > a > > > clear explanation in BX docs of how it work. The "Counting pulses > > > with hw interrupt" example is unfortunately single-task and it is > not > > > clear how that will affect the multi-task setup. > > > > > > My two questions are: > > > 1. If I have two tasks - one is a PID temperature controller that > has > > > to run all the time and another task runs rarely and should only > > > start if I press a button momentarily. > > > > > > If I issue a WaitForInterrupt command from the second task, will > it > > > stop the first one and just sit and wait for the interrupt (pin > 11, > > > right?) or will it allow the first task to run while waiting for > an > > > interrupt? > > > > > > 2. Is it really worth it to play with interrupts as opposed to > just > > > having a small task that polls the pin? > > > > > > Thanks a million. > > > > > > Alex. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > __________________________________________________ > > > > __________________________________________________ |
|
--- In basicx@y..., "Alex Chaihorsky" <alex_chaihorsky@h...>
wrote: > I never worked with BX-24 HW interrupts before and have not found a > clear explanation in BX docs of how it work. You might try a search on "interrupt" in this group. I asked similar questions a while back and got some more useful info. > 2. Is it really worth it to play with interrupts as opposed to just > having a small task that polls the pin? I generally use tasks to poll the pin with good sucess. Unless the 2ms per task wait is too much for you. Stan |