cancel
Showing results for 
Search instead for 
Did you mean: 

General purpose timer

ajimathew
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
KDJEM.1
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

ajimathew
Associate III

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

 

MHank.1
Associate III

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

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 Accept as Solution on the reply which solved your issue or answered your question.