clock speed T0 EICO-28

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

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:

clock speed T0 EICO-28

Post by jadiflow »

Hi,

I have a question on the clock speed for an EICO-28 Timer0. According to the data sheet, the internal selected clock will be Fosc/4. Since the EICO has a 4Mhz oscillator, that would be a 1uS clock.
However, when configuring T0 in a Flowcode 5 INT block, the internal clock selection available is CLK0 Internal clock shown as 48Mhz, which is the internal instruction clock.
So which is it? Anybody used this and knows?

thanks,

jan didden

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: clock speed T0 EICO-28

Post by medelec35 »

Hi jan,
EICO-28 will use PLL function which will multipy the oscillator to 48MHz.
With a prescaler of 1:1 the interrupt frequency of 46875Hz is correct.
(40MHz/4/256)

Martin
Martin

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

Re: clock speed T0 EICO-28

Post by jadiflow »

Thank Martin,

So, counter clock trigger will be 10Mhz meaning that with a 1:256 prescaler there will be a T0 counter clockpuls every 25.6uS.
So, using the full counter width of 16 bits, that means a clock roll-over after a maximum of 1.677 Seconds.
Yet Flowcode mentions an interrupt freq of 183 Hz. Hmmmm. What's wrong with my reasoning?

jan

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

Re: clock speed T0 EICO-28

Post by jadiflow »

I think what the int freq in the component dialog gives is the int freq assuming you use the timer as an 8-bit timer.
That would indeed give 183 Hz with a 48MHz osc freq.

It's clear to me now. But it might confuse people if they use a 16-bit timer and not immediately realise that the info given assumes an 8-bit timer.
Maybe something for a future update?

jan

User avatar
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: clock speed T0 EICO-28

Post by Benj »

Hi Jan,

Hm that's an interesting one. We always assume that timer 0 is 8-bit, timer 1 is 16-bit and timer 2 is 8 bit etc... This is normally the case except where you have the extra option between 8 or 16bit functionality on timer0 like on the 2455 family.

I will make a note about looking into this but I cannot see us changing the way the timer interrupts work in the near future as this requires a huge amount of effort to get right for all the devices and we have other more pressing things to be upgrading or working on that would yield better benefits to the users. I could be wrong about this though, if it is easy I will try and fit it in somehow.

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

Re: clock speed T0 EICO-28

Post by jadiflow »

Hi Ben,

I believe a simple note on the dialog form would go a long way to make people aware.
Once you are aware it becomes a non-issue.

BTW Let me take this opportunity to compliment you guys with V 5.
The addional drop-down windows with macros, variables, constants, auto FC to C label conversion etc are huge time savers.
Definitely worth the upgrade price!

jan

Post Reply