Topic : ISR routine

Forum : ARM

Original Post
Post Information Post
June 23, 2007 - 6:55pm
Guest

Hi,

Basic question about interrupt routine in GNU c for the STR730. I want to read a value from a sensor on a spi bus and then filtering and other calculations. The value is read with the function INCS_ReadX() every 500us.

How to do this in interrupt ?

void IRQHandler (void)
{

if (timer>500us)
{
xtemp=INCS_ReadX();
Xangle=(XAngle*7+xtemp)>>3;
}

};

What timer to use and setup?

Regards, Bram

Replies
Post Information Post
+1
0
-1
June 25, 2007 - 5:37pm
Raisonance Support Team

Hi,

This is more a question concerning the STR73x_lib than the GNU GCC, really. Therefore, ST should be able to answer better than us. I suggest you contact them.

However, I think you will find all the information you need in the RTC example of the lib. Look there:
"C:\RIDE\LIB\STRX\STR73X_LIB\EXAMPLES\RTC\RTC.prj"
And maybe also there:
"C:\RIDE\LIB\STRX\STR73X_LIB\EXAMPLES\TIM\TIM.prj"

The configuration of the timers, which is what you need, can be found in the "main.c" file, in function "main()", in both projects.

And you might want to take a look at the other projects in this folder:
"C:\RIDE\LIB\STRX\STR73X_LIB\EXAMPLES\..."

I hope it helps,

Best Regards,

Vincent