'STM32F103xB'에 해당되는 글 2건

  1. 2012.03.13 STM32F103xx 시리즈 18Mhz로 토글
  2. 2012.03.08 STM32F103RBT6, STM32F103xB

 

STM32F103xx IO

 

STM32F103 시리즈는 최대 72Mhz까지 동작합니다. 그렇다고 모든 기능이 72Mh로 동작하는 것은 아니고, 각 기능마다 약간씩 다릅니다. 그 중에서 I/O 토글링은 18Mhz까지 제어할 수 있습니다.

 

 

 

 

While 사용

 

 

 

 

위와 같이 기본값을 설정하고 main 에서 while문으로 PORTE의 4번핀을 토글하게 되면

18Mhz로 동작할거 같은데 실제로는 아래처럼 3.13Mhz 로 파형이 나옵니다.

 

 

 

 

 

 

 

Optimizations

 

 

이는 컴파일 옵션에서 옵티마이즈가 None으로 되어 있어서 그런 겁니다.

아래처럼 옵션에서 High(Speed)로 지정하면 됩니다.

 

 

 

 

그러면 약 8Mhz까지 나옵니다.

 

 

 

 

왜 8Mhz 까지만 나올까요?

그것은 while(1) 때문입니다. 아래 2줄을 수행한 후 while문을 검사해야 하기 때문에 8Mhz 이상이 나오지 않는 겁니다.

GPIOE->BSRR = GPIO_Pin_4;
GPIOE->BRR = GPIO_Pin_4;

 

 

 

 

그렇다면 어떻게 해야 18Mhz 를 얻을 수 있을까요?

While(1)을 사용하지 않으면 될텐데…. While(1)을 사용하지 않는다면 프로그램은 무한히 실행되지 않을 겁니다.

 

그냥 while(1) 문 안에 무한히 토글해주면 됩니다.

 

 

while(1){

GPIOE->BSRR = GPIO_Pin_4;

GPIOE->BRR = GPIO_Pin_4;

GPIOE->BSRR = GPIO_Pin_4;

GPIOE->BRR = GPIO_Pin_4;

}

13.0902Mhz

 

 

 

 

while(1){

GPIOE->BSRR = GPIO_Pin_4;

GPIOE->BRR = GPIO_Pin_4;

GPIOE->BSRR = GPIO_Pin_4;

GPIOE->BRR = GPIO_Pin_4;

GPIOE->BSRR = GPIO_Pin_4;

GPIOE->BRR = GPIO_Pin_4;

}

13.4992Mhz

 

 

 

 

아래처럼 하면 거의 18Mhz에 가까워 집니다.

 

 

 

출처 : http://whiteat.com/56416

 

 

Posted by WhiteAT
,

 

STM32F103RBT6

 

DATA SHEET:



 

 

 

 

 

Features

 

■ ARM 32-bit Cortex™-M3 CPU Core

– 72 MHz maximum frequency, 1.25 DMIPS/MHz (Dhrystone 2.1) performance at 0 wait state memory access

– Single-cycle multiplication and hardware division

■ Memories

– 64 or 128 Kbytes of Flash memory

– 20 Kbytes of SRAM

■ Clock, reset and supply management

– 2.0 to 3.6 V application supply and I/Os

– POR, PDR, and programmable voltage detector (PVD)

– 4-to-16 MHz crystal oscillator

– Internal 8 MHz factory-trimmed RC

– Internal 40 kHz RC

– PLL for CPU clock

– 32 kHz oscillator for RTC with calibration

■ Low power

– Sleep, Stop and Standby modes

– VBAT supply for RTC and backup registers

■ 2 x 12-bit, 1 μs A/D converters (up to 16 channels)

– Conversion range: 0 to 3.6 V

– Dual-sample and hold capability

– Temperature sensor

■ DMA

– 7-channel DMA controller

– Peripherals supported: timers, ADC, SPIs, I2Cs and USARTs

■ Up to 80 fast I/O ports

– 26/37/51/80 I/Os, all mappable on 16 external interrupt vectors and almost all 5 V-tolerant

■ Debug mode

– Serial wire debug (SWD) & JTAG interfaces

■ 7 timers

– Three 16-bit timers, each with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input

– 16-bit, motor control PWM timer with deadtime generation and emergency stop

– 2 watchdog timers (Independent and Window)

– SysTick timer 24-bit downcounter

■ Up to 9 communication interfaces

– Up to 2 x I2C interfaces (SMBus/PMBus)

– Up to 3 USARTs (ISO 7816 interface, LIN, IrDA capability, modem control)

– Up to 2 SPIs (18 Mbit/s)

– CAN interface (2.0B Active)

– USB 2.0 full-speed interface

■ CRC calculation unit, 96-bit unique ID

■ Packages are ECOPACK®

 

 

 

 

 

'[STM32] > IC' 카테고리의 다른 글

STM32F103ZET6, STM32F103xE  (0) 2012.03.09
STM32F215RET6, STM32F215XX  (0) 2012.03.08
STM32F103VET6, STM32F103xE  (0) 2012.03.08
STM32F205RET6, STM32F205xx  (0) 2012.03.08
STM32F103RCT6, STM32F103xC  (0) 2012.03.08
Posted by WhiteAT
,