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