Page 1 of 1

Do I need Storage pack to use internal timer (FC9; PIC16F)

Posted: Sun Dec 19, 2021 4:56 pm
by jadiflow
Hi, I want to use the PIC internal timer and I thought there would be some Flowcode component macros or functions for that, but I don't see any.
Do I have to use C-blocks to set the appropriate registers, or do I need the Storage lib?
There is some indication that the Storage lib has high level Timer macros, but I'm not sure.

Jan Didden
Linear Audio

Re: Do I need Storage pack to use internal timer (FC9; PIC16F)

Posted: Sun Dec 19, 2021 7:09 pm
by chipfryer27
Hi

Sorry to be brief, awaiting boarding call (should be bored call).

Do you mean the Internal Oscillator or timer interrupts?

The interrupts are relatively straightforward and the Interrupt Macro is quite self explanatory.

To set the PIC to use the internal clock then you do need to use a C-Block at the very beginning of your chart / code. I assume you are using FCv8 as you have posted in the forum and v8 has a tool to assist.

From header bar select Runtime -> Matrix Tools -> IntOsc Helper

Enter a frequency and the helper will check if it is valid and if so generate the necessary code. Simply copy this and paste in a C-block right at the start of your chart. I'm sure someone will jump in with more details, but I'm a bit short on time. You could try the wiki too for examples.

Hope this helps,

Regards

Re: Do I need Storage pack to use internal timer (FC9; PIC16F)

Posted: Sun Dec 19, 2021 8:10 pm
by jadiflow
Thanks for your reply - hope you're airborne by now!
I have the oscillator sorted by writing to the OSCONx registers directly. The Device Configuration settings in the Project Options don't seem to work.
BTW I am running Flowcode 9, just updated a few days ago from FC7, so a bit unfamiliar, it may be operator error.

I was specifically asking on the use of the internal timer/counters Timer1, Timer2 etc), not necessarily using interrupts; in some of my projects I use polling.
In the old Flowcode 5 you could call a component macro to manage the internal counters/timers.
I don't see any of that in FC9, so I thought maybe I need to buy another package for that. I only got the basic FC9 package.
Of course I can manipulate the counter/timer registers through a C-block, but that sort of defeats the purpose of FC for me.

Jan Didden
Linear Audio

Re: Do I need Storage pack to use internal timer (FC9; PIC16F)

Posted: Sun Dec 19, 2021 10:26 pm
by medelec35
Hi Jan,
I have moved your post from Tips and tricks that is for only sharing your own tips.
We can resume this thread on the V9 forums, so other v9 users can benefit.