ARM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

ARM

Post by wayne millard »

Hi every body,

Can i get a 1us interrupt from the arm ecio?

Thanks,
Wayne :)

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: ARM

Post by Benj »

Hello Wayne,

At the moment Flowcode only supports multiples of the prescaler clock allowing for a max interrupt rate of 93600Hz. I know there is a way of creating timer interrupts that are more controllable by changing the value that is loaded into the overflow register.

Probably by using the following line of C code with a timer 1 interrupt.

Configure the timer interrupt as follows.
Internal Count 1:2
Count Mode - 8bit

Then add the following line of C code after the interrupt enable icon.

AT91C_BASE_TC1->TC_RC = 0x00000018;

This is not perfect but it will give you an interrupt rate of approx 1.0016us.

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

Re: ARM

Post by wayne millard »

Thanks Benj

I will give it a go thanks for the fast reply.

Wayne :D

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

Re: ARM

Post by wayne millard »

Hi BenJ,

i tried what you said but could not get to work what have i done wrong.
Checked with a oscilloscope only stays high.

Thanks,
Wayne
Attachments
test.fcf_arm
(5 KiB) Downloaded 297 times

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: ARM

Post by Benj »

Hello Wayne,

I have had a quick go here and its looking like the interrupt is triggering so fast that the main program never gets chance to run. Incrementing the timer overflow value a bit starts the program running as expected so I think this must be the problem. There must be more overhead to the interrupt routine then I originally thought. Sean is the guy who would know but he is currently away on holiday this week.

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

Re: ARM

Post by wayne millard »

Thanks benj,

i need to generate times from as little as 50us to 30ms to a accuracy of 1us. i tried with a pic could only get about 10us. so then got the arm development hopping that this would do it.

Thanks
Wayne

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: ARM

Post by Benj »

Hello Wayne,

Ok you could do something like this.

You know that loading the value 0x18 into the timer rollover register gives a 1us delay so you can simply multiply up this number to give you the accurate delay you require.

eg
50us would equal 50 x 0x18 = 0x4B0
30ms would equal 30 x 1000 x 0x18 = 0xAFC80

So instead of multiple timer interrupts you simply have one that runs for the entire delay.

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times

Re: ARM

Post by wayne millard »

Hi benj,

i need to calculate the time that i require in a menu. To generate a start and stop pulse's.
in a interrupt i counted the number of interrupts to give the required time.

So how would i do the same thing?

Thanks,
Wayne

Post Reply