Page 1 of 1

Timer Component

Posted: Fri Oct 15, 2021 1:36 pm
by Dave_Squibb
Hi, I'm having trouble with this component. Trying to measure an 80mS period. Using GetCountMicroseconds() the return value is ULONG. A ULONG
variable is 0 - 0xFFFFFFFF. 80mS (82000 microseconds) measures as 0x00014050 but the Timer component only returns 00004050. I know I can use
GetCountMilliseconds but I need the resolution of microseconds. Is there a bug or should the return value be UINT?
The processor is a PIC16F1938. Flowcode V8.2.2.15 Thanks, Dave.

Re: Timer Component

Posted: Mon Oct 18, 2021 1:42 pm
by BenR
Hi Dave,

Please can you post your project file and we will investigate the problem for you.

We've recently had a similar problem with the timer being started from within an interrupt, this can cause problems as it can cause the interrupt to be false retriggered which can have the effect of stopping the timer again and therefore returning a false count.

Re: Timer Component

Posted: Tue Oct 19, 2021 10:31 am
by Dave_Squibb
Hi Ben,
The relevant part of the code is the Macro Direction. Other code in Main() is bypassed.
JIG_X_4_test_1.fcfx
(40.08 KiB) Downloaded 109 times
Thanks,
Dave