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

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

Moderator: Benj

Post Reply
jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

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

Post 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

chipfryer27
Valued Contributor
Valued Contributor
Posts: 664
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 184 times
Been thanked: 203 times
Contact:

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

Post 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

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

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

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

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

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

Post Reply