Other Parts Discussed in Thread: HALCOGEN
We're looking into using N2HET pins to measure pulse trains by using HALCoGen to generate CAP code.
HALCoGen can generate a "capGetSignal()" function which "Gets current signal of the given capture signal." (Requires that we have used HALCoGen to have mapped our selected pins to the HET CAP blocks.)
This function reports "duty cycle in %" and "period in us".
I am assuming that this is reporting the data for the single, most recently captured complete period, is that correct? (That the underlying HET micromachine code is not doing any averaging over time of multiple periods, for example.)
capGetSignal() is performing two successive reads on data from HET RAM. Are there any atomicity issues we should be aware of, where the HET micromachine could be updating one or both of them at the same time that we're reading them, resulting in us getting invalid data?
Are there any side effects from performing these reads? (Does reading them reset them in any way?)
capGetSignal() is performing a division using a value read from HET RAM as the divisor, without confirming first that that value is non-zero. What can we do prior to calling capGetSignal() to ensure that we won't have an error?
--thx