This is an excerpt of a code written for an STM32F407 microcontroller. Describe what you expect to see when the code run

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

This is an excerpt of a code written for an STM32F407 microcontroller. Describe what you expect to see when the code run

Post by answerhappygod »

This Is An Excerpt Of A Code Written For An Stm32f407 Microcontroller Describe What You Expect To See When The Code Run 1
This Is An Excerpt Of A Code Written For An Stm32f407 Microcontroller Describe What You Expect To See When The Code Run 1 (37.99 KiB) Viewed 24 times
This is an excerpt of a code written for an STM32F407 microcontroller. Describe what you expect to see when the code runs. static void MX_TIM2_Init(void) { htim2. Instance = TIM2; htim2.Init.Prescaler = 1049; htim2.Init. CounterMode = TIM_COUNTERMODE_UP; htim2.Init. Period 999; htim2. Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim2. Init. AutoReload Preload = TIM_AUTORELOAD_PRELOAD_DISABLE; } void HAL_TIM_PeriodElapsedCallback(TIM_Handle Type Def *htim) { if(htim->Instance == htim2. Instance) { HAL_GPIO_TogglePin (GPIOD, GPIO_PIN_15); } } int main(void) { } HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_TIM2_Init(); HAL_TIM_Base_Start_IT(&htim2); while (1) { TIM2->PSC = 20999; HAL_Delay(5000); TIM2->PSC = 41999; HAL_Delay(5000); }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply