Am attempting to use the TCU module on a Q2686 (F/W R7.4) to build a simple frequency counter.
First issue: The documentation indicates that you configure the TCU handler with ‘the pin number’ that is to be used to count the events on. No obvious API documentation to indicate that ‘the pin number’ actually refers to one of the INT pins (i.e. INT0 or INT1), not a generic GPIO pin. A trap for the unwary there…
Now that I can actually count events on an interrupt pin, I hit the next snag: I can’t set up an event count duration of 1 second (== 1000 mS == 1000000 uS == 1000 x ‘tcu_EvCaptUnit’ as read from the hardware registry.) If I use 1000 as the adl_tcuEventCaptureSettings_t::Duration value, I get an ADL_RET_ERR_PARAM returned when I do the adl_tcuSubscribe() call. A value of 500 (500mS), or 100 (100mS) works fine - the low level interrupt handler is called as expected. I shouldn’t be overflowing the Duration value as it is supposed to be a u32 type.
Has anyone else had this issue? Being unable to count events over the period of 1 second doesn’t seem that unreasonable to me (it’s a direct conversion to Hz, after all).
The next thing I notice is that with a count period of 500mS, when I ramp the input frequency up over approx 31kHz (measured roughly off the freq. gen. dial, so could be over 32kHz), the Q2686 hangs. Interrupts stop and then I get a WATCHDOG timeout and reboot!
What gives here? I would have expected that the counter would have eventually started missing counts and given a wrong result. All the data types exposed in the API appear to be of type u32, so 32kHz shouldn’t be rolling over an internal counter - unless someone has taken a shortcut and is using a s16 internally somewhere which may be overflowing.
As noted above, I’m using a Q2686 (G modem), running R7.4 firmware and M2M Studio 1.0.2.
Any thoughts would be appreciated.