본문 바로가기
코스웨어/13년 스마트컨트롤러

Cortex-M3 LED 켜기

by 알 수 없는 사용자 2013. 10. 22.
728x90
반응형

 

 LED 켜기 (PC12)

 #define  RCC_AHBENR    (*(volatile unsigned int*)0x40021014) 
 #define  RCC_APB2ENR    (*(volatile unsigned int*)0x40021018) 
 #define GPIOC_CRH  (*((volatile unsigned int *)(0x40011004)))
 #define GPIOC_ODR  (*((volatile unsigned int *)(0x4001100C)))
 #define GPIOC_BSRR  (*((volatile unsigned int *)(0x40011010)))
 #define GPIOC_BRR  (*((volatile unsigned int *)(0x40011014)))

 


 unsigned int uiCnt;
 
  RCC_APB2ENR |= (1<<4); //PC의 클럭 인에이블   
 //RCC_APB2ENR = 0xFFF;   
 //RCC_AHBENR |= (1<<2) | (1<<6);   


  GPIOC_CRH = (0x3 << 16);
  GPIOC_ODR = (1 << 12);
 
 //GPIOC_BSRR = (1 << 12);
 
 while(1)
 {
    GPIOC_BSRR = (1 << 12);

    for(uiCnt = 0 ; 2000000 > uiCnt; ++uiCnt);
      
   
    GPIOC_BRR  = (1 << 12);
    for(uiCnt = 0 ; 2000000 > uiCnt; ++uiCnt);
 }

 while(1);
 return 0;

}

 

 

 

 

728x90

'코스웨어 > 13년 스마트컨트롤러' 카테고리의 다른 글

비트맵 색 이래저래 바꾸어 출력하기 - 조유진  (0) 2013.10.23
Cortex-M3 로 캐릭터 LCD 제어하기  (0) 2013.10.23
소코반 - 손초롱  (1) 2013.10.22
Cortex-M3 LED 깜빡이기  (0) 2013.10.22
WndProc  (0) 2013.10.21
2013.10.21_ARM Cortex-M3 _ 메뉴얼  (2) 2013.10.21
Cortex-M3 예제소스  (0) 2013.10.18
M3 회로도  (0) 2013.10.18