cancel
Showing results for 
Search instead for 
Did you mean: 

Basic timer interrupt example?

NCarl
Associate II

Beginner requesting an example of a timer interrupt every 20 us. Am using a Nucleo-F767ZI. Not sure if CubeMX is used for this as the interrupt is timer not external?

7 REPLIES 7
S.Ma
Principal

I would suggest to avoid having 20us interrupt rate, for example by using the HW peripheral better configured to the device functional needs.

Most timer examples are in Cube corresponding Nucleo board, project example for TIMER.

What is the 20us interrupt used for?

NCarl
Associate II

Attempting VGA display output.

S.Ma
Principal

There are many people who tries analog video output using switch resistor divider outside to do a display DAC, sometime using DMA2D peripheral. Otherwise, how about looking for DSI to LVDS or HDMI adapter? The discovery board has such add-on board for STM32F76x

Get as much HW assisted SW as possible.

NCarl
Associate II

Thanks for the information. DSI is on my radar and the HDMI adapter may be as well. I would like to have even a simple 1000 ms LED blink interrupt down as I am getting familiar with TrueStudio. I have tried mbed however am looking for more precise timing and next the 400 MHz Nucleo as well.

NCarl
Associate II

I have with a simple 64 MHz Microchip displayed vertical bars of all the colors of red green and blue by use of an 8 bit resistor divider however clocking out the 640 pixels per line ended up being more like 4 horizontal pixels displayed in place of one as the pic is a bit slow for this app.

NCarl
Associate II

I am working to build a simple interrupt example of say 1 second with a 216 MHz STM32F767 however only one interrupt occurs. I have in my program read the relevant mcu registers to determine TIM3 clock is APB1 x 2 = 216 MHz. I have entered prescaler 215 and period 999 into CubeMX and enabled the interrupt.

if Update Frequency = (TIM_CLOCK / (Prescaler + 1)) / (Period +1) then

Update Frequency 1000 MHz (1 sec) = (216,000,000/ (215 + 1)) / 999 + 1)

What might I have missed?

S.Ma
Principal

ST provides you peripheral example around Nucleo in cube library example projects. Look at Timer or RTC example with interrupt.

Examples maybe good to learn how peripheral work.