I am a new bee to the STM32 Micro controller, I am working with the STM3210E evaluation board. Can any one hint me on how to generate A TIMER INTERRUPT every X microseconds.
Hello, the Cortex-M3 has a dedicated unit for this role, it is the SysTick unit.
You have to setup the interrupt vector and priority for the systick unit and then start the timer. This is an example: #define ENABLE_ON_BITS (1 << 0) #define TICKINT_ENABLED_BITS (1 << 1) #define CLKSOURCE_EXT_BITS (0 << 2) ST_RVR = SYSCLK / (8000000 / CH_FREQUENCY) - 1; ST_CVR = 0; ST_CSR = ENABLE_ON_BITS | TICKINT_ENABLED_BITS | CLKSOURCE_EXT_BITS; SYSCLK is the system clock in Hertz, CH_FREQUENCY is the interrupt frequency. The above code is present in the project you can see in my signature inside a STM32 demo program. --- ChibiOS/RT