Routine Cycle Times

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
emrekaya
Posts: 7
Joined: Thu Aug 02, 2007 8:13 pm

Routine Cycle Times

Post by emrekaya »

Hi,

May i learn the cycle requirements for Flowcode routines, especially interrupts, compare and addition ?

Last minute addition: I forgot to tell the following ASM compiler error
Error: Failed to open:libc.pic18.lib or C:\Program Files\SourceBoost\lib/libc.pic18.lib
Installting the Sourceboost also doesnot solve the problem
Error: .obj or .lib file Incompatible version! (file uses V111, linker requires V109 to V109)
Error: Failed to process:libc.pic18.lib

Cycle related problem is as follows:

there is a 50 khz to 120khz signal that has to be measured under 100 ms around 0.2 hz resolution at the highest ferquency (compared to 10 sec normal methods). As you all know for simple counting operations frequency is read at 1 sec intervals for 1 hz and 10 secs for 0.1 hz.
To speed up the procedure I constructed a 24 bit 10mhz counter from standard logic blocks with pic synchronization as an external counting referance. Pic is 18f252 at 40mhz (1ppm accuracy tcxo).
Goal is to input the raw frequency to an interrupt and every 5000 counts stop the counter read the value with 3x 8 bit packages and transmit it thru serial. Thus producing a 10mhz frequency division determined by the input frequency, data output rate varies between 24 and 10 hz but this is not important.
With the given specs of the pic at 10mips at the maximum frequency of 120khz there is a 83 cycles instruction window.
is this window enough for the following procedure ? can you give info on the routine cycle times ?
INT0 (get pulse)
a=a+1 (increase counter) (a is integer)
if a=5000 ra1=1 (stop the counter)

I also checked the boost c forums etc and couldn't find info on the routine cycle times.

note: asm seems the most efficient way but hmm hrrrr. I hate it more than monkeys hate water :oops:
note 2: I want to thank you guys for creating such a good program. Waiting excitedly for the V4, I hope you'll release it soon.
Last edited by emrekaya on Wed May 06, 2009 11:07 pm, edited 1 time in total.

emrekaya
Posts: 7
Joined: Thu Aug 02, 2007 8:13 pm

Re: Routine Cycle Times

Post by emrekaya »

*Made a sample program and counted the asm command cycle times, roughly around 73(assuming even the 1 cycle commands are 2 cycle and some 3 cycle commands are 2. (2 cycle followed by another 2 cycle results in 3 cycle thanks to the small notes on the data sheet :twisted: I hate timing specific applications :lol: )

*Broken link problem is fixed when i did the 3.6 version patch. ASM Compiler working correctly now.

But i still think that it is a good idea to roughly list the cycle times of internal routines for other users =D As it is quite 'torturing' to count the cycletimes of automatically generated asm codes :mrgreen:

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Routine Cycle Times

Post by Steve »

Unfortunately, it's not that easy because the cycle times depend on the version of the compiler (which can change) and any optimizations that are performed.

The best way I suggest to do this is to write the time-critical routine in Assembly within a C icon block. That way, you will know exactly how long the routine takes.

Note also that you can inspect the generated C and ASM code but looking at the .casm file that is produced when you compile a flowchart. This will enable you to work backwards to determine the amount of instructions used for a particular piece of code.

Post Reply