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.
Timer Component
-
- Posts: 2
- http://meble-kuchenne.info.pl
- Joined: Mon Dec 14, 2020 6:11 pm
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Timer Component
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 2
- Joined: Mon Dec 14, 2020 6:11 pm
Re: Timer Component
Hi Ben,
The relevant part of the code is the Macro Direction. Other code in Main() is bypassed. Thanks,
Dave
The relevant part of the code is the Macro Direction. Other code in Main() is bypassed. Thanks,
Dave