Timer Component

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Dave_Squibb
Posts: 2
http://meble-kuchenne.info.pl
Joined: Mon Dec 14, 2020 6:11 pm

Timer Component

Post 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.

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Timer Component

Post 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.

Dave_Squibb
Posts: 2
Joined: Mon Dec 14, 2020 6:11 pm

Re: Timer Component

Post 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 106 times
Thanks,
Dave

Post Reply