EEM-465 Gömülü Sistemler
2022-2023 Güz Dönemi Ders 12
HSI clock kaynagını kullanma
#include "stm32f4xx.h"
int main(){
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOEEN;
GPIOE->MODER |= GPIO_MODER_MODER3_0;
RCC->CR |= RCC_CR_HSEON;
while(!(RCC->CR & RCC_CR_HSERDY));
RCC->CFGR |= RCC_CFGR_SW_0;
RCC->CR &= ~RCC_CR_HSION;
SysTick->LOAD = 4000;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
while(1){
GPIOE->ODR |= GPIO_ODR_OD3;
while(!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk));
GPIOE->ODR &= ~GPIO_ODR_OD3;
while(!(SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk));
}
}