Hi Ben
At first.. Interrupt with FC8 are very nice to use. It is so easy to set the desired frequency and the later in the hardware the frequency is correct.
Sometimes you want to change this frequency during the program.
For the next flowcode version...
Would it be possible to set the rollover value with a variable?
And would it be possible to show the time in second (millisecond) in addition to the frequency?
regards
Stefan
Interrupt set rollover value with a variable
Moderator: Benj
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Interrupt set rollover value with a variable
Hi Stefan,
Great suggestion there thanks I'll pass it on and see if we can do anything with it.
Great suggestion there thanks I'll pass it on and see if we can do anything with it.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Steve
- Matrix Staff
- Posts: 3424
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Interrupt set rollover value with a variable
Thanks for the suggestion, Stefan.
I've spent some time investigating this suggestion this morning and it is possible, but would require a lot of effort.
As a workaround, you could add the appropriate C code to change the rollover value to a variable's value. This code would depend on the chip and timer module and you can find the appropriate code by either viewing the C code for the interrupt icon within Flowcode or by looking at the chip's FCDX file and searching for "rollover".
For example, the TMR2 module in the 16F18877 uses the following code to set the rollover to 111:
To change the rollover value to a variable value (for example, the global variable "rollover"), add a C code icon with the following:
I hope this helps.
Steve.
I've spent some time investigating this suggestion this morning and it is possible, but would require a lot of effort.
As a workaround, you could add the appropriate C code to change the rollover value to a variable's value. This code would depend on the chip and timer module and you can find the appropriate code by either viewing the C code for the interrupt icon within Flowcode or by looking at the chip's FCDX file and searching for "rollover".
For example, the TMR2 module in the 16F18877 uses the following code to set the rollover to 111:
Code: Select all
PR2=111-1
Code: Select all
PR2=FCV_ROLLOVER-1
Steve.
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Interrupt set rollover value with a variable
Hi Steve
Thanks a lot. It's working nice the way you wrote.
regards
Stefan
Thanks a lot. It's working nice the way you wrote.
regards
Stefan