Skip to main content
Associate II
July 6, 2023
Solved

General purpose timer

I came across the term in the user manual of L4P5 series that shadow register, auto preload register and auto reload register in timer operation

what is the difference between three of them?

This topic has been closed for replies.
KDJEM.1
KDJEM.1Best answer
ST Technical Moderator
July 7, 2023

Hello @ajimathew ,

  •  The active register instance (also called the shadow register instance): its content is used by the timer peripheral logic to generate the timer channel outputted waveforms.
  • The preload register instance: this is the register instance accessed by the software when the preload feature of the concerned register is enabled.
  • The auto-reload register is preloaded.

So, writing to or reading from the auto-reload register accesses the preload register. The content of the preload register are transferred into the shadow register permanently or at each update event (UEV), depending on the auto-reload preload enable bit (ARPE) in TIMx_CR1 register.

For more explanation I advise you to take a look at AN4776 General-purpose timer cookbook for STM32 microcontrollers  and precisely 1.4.2 The preload feature of the timer registers  Section.

When your question is answered, please close this topic by choosing "Accept as Solution". This will help other users find that answer faster.

Kaouthar

 

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.

4 replies

KDJEM.1
KDJEM.1Best answer
ST Technical Moderator
July 7, 2023

Hello @ajimathew ,

  •  The active register instance (also called the shadow register instance): its content is used by the timer peripheral logic to generate the timer channel outputted waveforms.
  • The preload register instance: this is the register instance accessed by the software when the preload feature of the concerned register is enabled.
  • The auto-reload register is preloaded.

So, writing to or reading from the auto-reload register accesses the preload register. The content of the preload register are transferred into the shadow register permanently or at each update event (UEV), depending on the auto-reload preload enable bit (ARPE) in TIMx_CR1 register.

For more explanation I advise you to take a look at AN4776 General-purpose timer cookbook for STM32 microcontrollers  and precisely 1.4.2 The preload feature of the timer registers  Section.

When your question is answered, please close this topic by choosing "Accept as Solution". This will help other users find that answer faster.

Kaouthar

 

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
ajimathewAuthor
Associate II
July 8, 2023

Hello @KDJEM.1 . Okay I partially understood the above answer. But what do you mean by  "auto-reload register is preloaded" ?

 

KDJEM.1
ST Technical Moderator
July 10, 2023

Hi @ajimathew ,

The preload feature of the timer registers section in AN4776 General-purpose timer cookbook for STM32 microcontrollers explains that the preload feature is available for the auto-reload timer register (TIMx_ARR).

The TIMx_ARR timer register contains the reload value of the timer counter.
– If the timer counter is up-counting and it reaches the content of the timer auto-reload register (TIMx_ARR), then the timer counter resets itself and a new counting cycle is restarted.
– If the timer counter is down-counting and it reaches the zero value, then the timer counter value is set to the content of the timer auto-reload register (TIMx_ARR) and a new counting cycle is restarted.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
MHank.1
Associate III
July 8, 2023

I've written a comprehensive article on STN32 Timers that map help to explain some questions you are having with Timers.

https://jaxcoder.com/Post/Index?guid=456f6a89-1a93-4a72-bab9-4cf3a9e7f9b6 

PartsBin - An Electronic Parts Organizer for Windows @ JaxCoder.com