??? 08/24/07 07:47 Read: times |
#143580 - Pipeline Responding to: ???'s previous message |
We have a classic case of a pipeline here. Having an analog to digital converter be it internal or external to the cpu would've been helpful here rather than converting to a frequency. Another technique would be to use a part with a PCA timer as it has capture inputs that could sample your frequency inputs in parallel. I would not be using interrupts for the trigger sensors - you could easily poll at a fixed rate and sample all your trigger inputs. Say we used a 1mS tick, all our timing is in relation to this (it should give enough resolution at a guess). We also have the color sensor values being continuously converted by the PCA hardware and interrupts so then it is a matter of software timers decremented by the 1mS tick, when these timers decrement to 0, we do something like get the current value of a color sensor. Each time you get a trigger input, these software timers are loaded with a value. Job done. Sounds like a job for a PLC - most of them have the built in features for the frequency measurement. The logic would remain much the same whether you used a PLC or microcontroller. A PLC is just a microcontroller anyway. So, think of your problem in discrete time intervals and the solution will be quite easy. |