Answered step by step
Verified Expert Solution
Question
1 Approved Answer
An MCU programmer wants to develop a real time chronometer, which can count to 1 0 0 minutes, on STM 3 2 F 4 by
An MCU programmer wants to develop a real time chronometer, which can count to minutes,
on STMF by using a timer peripheral TIM TIM has a bit TIMxPSC register, a bit
TIMxARR register, and a bit TIMxCNT register. TIM is connected to the APB bus. The source
clock of the timer is clock of the bus. Assume that all required settings and variable declarations are
done and the code will be executed after resetting.
i APB bus has arranged to have a clock frequency of MHz Analyze the below code and
determine the values, those should be written to related registers. Show your calculations and
justify your results. Determine the period of the timer and the time it takes to create an interrupt request.
TIMHandleTypeDef htim;
int mainvoid
TIMPSC;
TIMARR;
HALTIMBaseStartIT&htim;
Interrupt handler void TIMIRQHandlervoid
HALTIMIRQHandler&htim; clears IRQ
splitsecond splitsecond ; salise
if splitsecond
splitsecond ;
second second;
if second
second ;
minute minute ;
if minute
minute ;
Interrupt handler void EXTIIRQHandlervoid
HALGPIOEXTIIRQHandlerGPIOPIN; clears IRQ
iTIMxCNT;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started