Dear TI Engineer:
I have a problem when using Timer1 of CC2541(running BLE stack) to measure a external triangular wave drop from 3.3V to 0V. The external droping time can be controlled and the waveform is OK. I use the Capture Mode of Timer1.
The Clock of Timer1 is set to 32DIV of the system clock, so it's 1us per clk. Since it's a 16bit timer, the measure range is 0-65535us, that is 65ms.
When the droping time is about 1ms or below, the measure result is accurate and stable. No matter when I start the measurement in my program, the result is always stable. For example, the Timer1 counter result is between 0x0250-0x0258, the error is below 8 us.
But when the droping time is about 10ms(maybe 2ms, 3ms... the bound is not clear) or above(<65ms, the Timer is not overflow), the meaure result has a great error. For example, the Timer1 counter result is 0x11XX for 2 times and then 0x19XX for 1 time, unregularly. And the measure result is quiet different if I start the measurement in different place in my program.
I think the problem is revelant with the BLE stack, because when I run the measurement without BLE stack, the result is always right and stable.
Is it too high for the Timer to run 10ms and something conflict with the BLE stack?
WIshing for your reply!
We've stuck here for several weeks and the product deadline is quite near. We need to fix this problem as quickly as possible, or the boss will be mad!
Yours sincerely,
Frank