Ŵ JK(JK Electronics) ؼ , , ۼ Ǿ
JK(JK Electronics)
Դϴ. 㰡 ʰ , ϰų ϴ.



 

STM32F10x Dragon ߺ ޴


 
* Update history

- 2012.9.17 : ʱ Release
  2012.9.17 S/W Ʈ
  2012.11.5 RIDE7 Ʈ ߰ Ǿϴ.

- 2013.11.5 : Eclipse ȯ GCC ȯ ߰

   Ŭ ȯ
- code.google.com ֽ ҽڵ ٿε


 
1. STM32F10x Drgaon ߺ Ұ
2. STM32F10x Dragon ߺ
    2.1 CPU H/W ȸε
    2.2 Bottom H/W ȸε
    2.3 S/W
3. ⺻ ٿε ̵
    3.1 Dragon ߺ ⺻
    3.2 α׷ ٿε ̵
    3.3 Cortex-M3 Architecture
    3.4 STM32F10x ø
4. S/W ׽Ʈ
    4.1 LED
    4.2 Timer
    4.3 RTC
    4.4 SD Memory(FAT32)
    4.5 USB( HID Mouse )
    4.6 LCD Display
    4.7 EEPROM ׽Ʈ
    4.8 KEY Է ׽Ʈ
    4.9 nRF24L01(RF Test)
    4.10 MP3 Play ׽Ʈ
    4.11 UART2 ׽Ʈ
    4.12 RS485 ׽Ʈ
    4.13 CAN ׽Ʈ
    4.14 ADC ׽Ʈ
    4.15 DAC ׽Ʈ
    4.16 LCD1602 ׽Ʈ
    4.17 LCD12864 ׽Ʈ
5. α׷ ̵
    5.1 Keil MDK 4.2x
    5.2 IAR Workbench 6.x
    5.3 RIDE7
    5.4 GCC & Eclipse


 

1. STM32F10x Dragon ߺ Ұ

STM32 Cortex-M3 32bit ARM ߺ STM32F10x MCU Ͽ ִ 72 MHz
ӵ ϰ CPU Bottom尡 иǾ ֽϴ. Dragon Bottom 忡
nRF24L01 2.4Hz RF , MP3, , µ 2.8, 3.2, 4.3, 7.0 ġ TFT ġ LCD,
1602, 12864 LCD پ ֺġ ؼ ֽϴ.

(1) STM32F10x Dragon ߺ ǰ

纰 з
ǰ̸
ǰ ⺻
LQFP100 STM32F103VCT6 ߺ Internal 256KB Flash, 48KB SRAM
LQFP144 STM32F103ZET6 ߺ Internal 512KB Flash, 64KB SRAM

STM32 Dragon ߺ CPU STM32F10x Rabbit CPU Ͽϴ.
LCD̽ FSMC ̽ Ͽ Rabbit CPU High Density CPU ⸸ ϰ ֽϴ.



2. STM32F10x Dragon ߺ

2.1 CPU H/W ȸε

(1) LQFP100 ø H/W ( STM32F10x Rabbit CPU Ͽϴ.)

stm32


* LQFP100 ø ɸ

JTAG GND PE0 PB8 PB6 PB4 PD7 PD5 PD3 PD1 PC12 PC10 PC14
VCC PE1 PB9 PB7 PB5 PB3 PD6 PD4 PD2 PD0 PC11 PA15
PE2 PE3 VCC GND
VCC VCC PE4 PE5 PA13 PA12
JTRST GND PE6 VBAT PA11 PA10
JTDI GND PC13 PC14 PA9 PA8
JTMS GND PC15 GND PC9 PC8
JTCK GND VCC PC0 PC7 PC6
NC GND PC1 PC2 PD15 PD14
JTDO GND PC3 VSSA PD13 PD12
RESET GND VREF- VREF+ PD11 PD10
NC GND VDDA PA0 PD9 PD8
NC GND PA1 PA2 PB15 PB14
VCC GND PB13 PB12
PA4 PA6 PC4 PB0 PB2 PE8 PE10 PE12 PE14 PB10 GND GND
PA3 PA5 PA7 PC5 PB1 PE7 PE9 PE11 PE13 PE15 PB11 VCC

(2) LQFP144 ø H/W ( STM32F10x Rabbit CPU Ͽϴ.)

stm32

* LQFP144 ø ɸ
PF1 PF3 PF5 PF7 PF9 PF11 PF13 PF15 VCC VCC GND GND PG14 PG12 PG10 PG8 PG6 PG4 PG2 PG0
PF0 PF2 PF4 PF6 PF8 PF10 PF12 PF14 GND GND VCC VCC PG15 PG13 PG11 PG9 PG7 PG5 PG3 PG1
JTAG GND PE0 PB8 PB6 PB4 PD7 PD5 PD3 PD1 PC12 PC10 PC14
VCC PE1 PB9 PB7 PB5 PB3 PD6 PD4 PD2 PD0 PC11 PA15
PE2 PE3 VCC GND
VCC VCC PE4 PE5 PA13 PA12
JTRST GND PE6 VBAT PA11 PA10
JTDI GND PC13 PC14 PA9 PA8
JTMS GND PC15 GND PC9 PC8
JTCK GND VCC PC0 PC7 PC6
NC GND PC1 PC2 PD15 PD14
JTDO GND PC3 VSSA PD13 PD12
RESET GND VREF- VREF+ PD11 PD10
NC GND VDDA PA0 PD9 PD8
NC GND PA1 PA2 PB15 PB14
VCC GND PB13 PB12
PA4 PA6 PC4 PB0 PB2 PE8 PE10 PE12 PE14 PB10 GND GND
PA3 PA5 PA7 PC5 PB1 PE7 PE9 PE11 PE13 PE15 PB11 VCC

2.2 Bottom H/W ȸε

(1) Bottom H/W




* STM32F10X Dragon ߺ ȸε ٿε

2.3 S/W

ST Micronics(http://www.st.com)翡 ϴ ⺻ STM32F10x_StdPeriph_Driver, STM32_USB-FS-Device_Driver
ؼ ۼǾϴ.
LED, Timer, RTC, USB, RF(nRF24L01), MP3(VS1003B), 2.8, 3.2, 4.3, 7.0 ġ LCD, AT24C02 EEPROM, RS485, RS232,
CAN , ADC, DAC, 1602 Char LCD, 12864 ׷ LCD, Buzzer, µ, մϴ.
IAR Workbench, Keil MDK, Ride7 ҽ Ʈ ֽϴ.

(1) Ʈ 丮

prj EWARMv6
MDK-ARM
RIDE
IAR Embeded Workbench Version 6.x
RealView(Keil) MDK-ARM Version 4.2x
Raisonance's Ride7 Version 7.24.06.0251
lib STM32_USB-FS-Device_Lib_V3.4.0 ST's ǥ ̺귯
src   ڵ

(2) STM32 ǥ ̺귯 : STM32_USB-FS-Device_Driver_V3.4.0, STM32F10x_StdPeriph_Driver_V3.4.0
(3) Ʈ ҽ ٿε

- 2012.9.17 ҽ ٿε
- code.google.com ֽ ҽڵ ٿε

3. ⺻ ٿε ̵

3.1 Dragon ߺ ⺻

(1) CPU

CPU⿡ UARTŰ ϱ ؼ 4Pin ĿͰ ֽϴ.

- USB2Uart ٿδ for Rabbit ̿ؼ PC ø


stm32f103rbt6

- Ϲ USB2Serial ȯ ̺ ̿ؼ PC ø

Ϲ USB2Serial ȯ ̺ ̿ 쿡 Ʒ ׸ 4 CPU⿡ Ŀͷ ؼ
ϸ ˴ϴ.

stm32f103rbt6

(2) Bottom
Bottom 忡 USB to Serial Ʈ ̹ Ǿ ־ PC Mini USB̺ ̿ؼ Ͻø ˴ϴ.
USBƮ ؼ ޵ ֽϴ.

(3) PC USB to Serial ̹ ٿε ġ( â )

(4) ͹̳

PC ͹̳ ؼ Ʒ ޼ Ȯ ֽϴ.

stm32f103rbt6

CPU USER LED() ֽϴ.

3.2 α׷ ٿε ̵

* α׷ ٿε ̵ STM32F10x Rabbit ߺ带 Ͽϴ.
Dragon ߺ忡 STM32F10x Rabbit CPU ϰ ֱ ٿεϴ մϴ.

(1) ø ̿ (â)
STM32F ø JTAG ٿδ USART0 Ʈ ̿ؼ α׷ ٿε ִ ISP մϴ.
Ե ٿε常 ϰ ڵ ϴ.

(2) H-JTAG ̿ (â)

Keil MDK, IAR Workbench H-JTAG ̿ ٿε

(3) ARM-JTAG ̿ (IAR Workbench), KEIL MDK

Keil MDK, IAR Workbench ARM-JTAG ̿ ٿε

(4) ST-Link ̿ (â)

Keil MDK, IAR Workbench ST-Link ̿ ٿε

(5) RLink ̿ (â)
RIDE7 RLink ̿ ٿε

(6) J-Link EDU ̿
IAR Workbench J-Link EDU ̿ ٿε (â)


4. S/W ׽Ʈ

4.1 LED

stm32f103rbt6

[1] User LED on : CPU USER LED Bottom USER LED 3 ϴ.
[2] User LED off : CPU USER LED Bottom USER LED 3 ϴ.

4.2 Timer

stm32f103rbt6

[1] TIM2 ticktime test : CPU USER LED 1ʰ Դϴ.
[2] TIM2 blink stop : 1 Ÿ̸Ӱ ˴ϴ.

4.3 RTC

stm32f103rbt6

[1] RTC service start : RTC ͷƮ ޾Ƽ 1ʿ ѹ ð ǥ ְ ֽϴ.

stm32f103rbt6

[2] RTC service stop : RTC 񽺰 ˴ϴ.
ھ⿡ RTC ͸  ð ʽϴ.

4.4 SD Memory(FAT32)

FAT32 ý Ͽ SD޸𸮿 ֽϴ. MP3 Player ݵ ʿ Դϴ.
SD Memory ī带 ʽϴ. SD ޸ ī ,
̺κ ׽Ʈ Ϸ SD޸ ī带 ؼ Ʈ 帮 ϰڽϴ.
SD޸ ī PC FAT32 Ǿ ־ մϴ.
׽Ʈ Ϸ SD޸ ī ϴ.

- ù 2GB, 8GB Memory
- SanDisk 2GB, 8GB ޸


SD ޸ ׽Ʈ ؼ SD ޸𸮸 ߺ Ͽ մϴ.


stm32f103rbt6

[1] SD File List : SD޸ Ʈ ݴϴ.

stm32f103rbt6

[x] Exit SD test : ׽Ʈ ϰ ޴ ̵ մϴ.

4.5 USB( HID Mouse )

USB ̽ ׽Ʈ ؼ Dragon Bottom ʿ մϴ. Bottom USB to Serial Ʈ Ǿ ִ
¿ USB to Serial Ʈ ִ USB MiniƮ PC մϴ.

* USB ׽Ʈ ǻ
CAN ͷƮ USB ͷƮ Ұ մϴ.
USB ׽Ʈ ؼ ϴ ҽ hw_config.c void bsp_init_rcc(void) Լ Ʒ κ ּó ؾ մϴ.

RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1, ENABLE);


[1] USB service start : USB 񽺰 Ǹ Ʒ ׸ ġڿ "HID ԰ 콺" ˴ϴ.

stm32f103rbt6

͹̳ο "L", "R", "U", "D" Էϸ PC 콺 Ŀ ̰ ˴ϴ.

stm32f103rbt6

[2] USB service stop : USB 񽺸 մϴ.

4.6 LCD Display

(1) ͹̳ "6" Էϸ LCD ɴϴ.

stm32f103rbt6

Dragon ߺ 2.8, 3.2, 4.3, 7.0 ġ ġ LCD FSMC ̽ ϰ ֽϴ.
4.3ġ(480*272), 7.0ġ( 800*480) ػ ȭ żӵ 3.2ġ( 320*240 ) żӵ մϴ.
׽Ʈ Ͻ LCD ´ ޴ ͹̳ο ø ϸ ˴ϴ. ȭ Ʒ Ͻñ ٶϴ.

* 4.3ġ ġ LCD ׽Ʈ



* 7.0ġ ġ LCD ׽Ʈ



4.7 EEPROM Է ׽Ʈ

stm32f103rbt6

[1] EEPROM(AT24C02) Write : AT24C02 EEPROM Data Write մϴ.

stm32f103rbt6

[2] EEPROM(AT24C02) Read : AT24C02 EEPROM Data Read մϴ.

stm32f103rbt6

 

[x] Exit EEPROM test



4.8 KEY Է ׽Ʈ

Dragon ߺ忡 7 User KEY ֽϴ. ߿ BTN1 ~ BTN5 KEY Է ׽Ʈ غ ϰڽϴ.
BTN1 ~ BTN4 Polling KEYԷ ˻ Ͽ BTN5 EXTI(ܺ ͷƮ) ˻ Ͽϴ.

stm32f103rbt6

[1] KEY service start(polling & exti)

stm32f103rbt6

[2] KEY service stop(polling & exti) : KEY Է 񽺸 մϴ.

4.9 nRF24L01(RF Test)

(1) nRF24L01 ׽Ʈ ؼ 2 Dragon ߺ 2 nRF24L01 ʿ մϴ.
Dragon ߺ PC մϴ.

nRF24L01 ϱ

stm32f103rbt6

[1] nRF24L01 Rx Service Start : ù° ߺ忡 RX մϴ.

- RX忡 Ͱ ۵DZ⸦ ٸ
- Ʒ ȭ nRF24L01 쿡 ߻ϴ ȭ Դϴ.

stm32f103rbt6


[2] nRF24L01 Tx Service Start : ι° ߺ忡 TX͸ ϸ RX忡 ִ ߺ忡 ۵ ͸ ݴϴ.

stm32f103rbt6

ϰ ִ RX ͹̳ο RF Ͱ ŵ ȭ Դϴ.

stm32f103rbt6

4.10 MP3 Play ׽Ʈ

MP3 Play Ű ؼ SD޸𸮿 MP3ϵ PC ϰ ߺSD ޸ Ͽ մϴ. SD޸ ī PC FAT32 Ǿ ־ մϴ.
׸ VS1003B MP3 ־ մϴ

VS1003B MP3 ϱ


.
SD ޸ ī带 SD ޸ ī , ̺κ ׽Ʈ Ϸ SD޸ ī带 ؼ Ʈ 帮 ϰڽϴ.

׽Ʈ Ϸ SD޸ ī ϴ.

- ù 2GB, 8GB Memory
- SanDisk 2GB, 8GB ޸

ߺ忡 MP3 MP3 Ǿ ִ SD ޸𸮸 մϴ.

stm32f103rbt6

[1] MP3 Play Start : SD޸ Ʈ MP3 ϵ մϴ.

stm32f103rbt6

[2] Mp3 Play Stop : MP3 ߴ մϴ.

4.11 UART2 ׽Ʈ

ߺ UART1, UART2 ׽Ʈ ֽϴ. ׽Ʈ ϱ ߺ UART2(DB9 Ŀ)
PC Ű ͹̳ Ȥ ٸ α׷ 115200bps ӵ մϴ. Ʈ COM1(UART1)
մϴ.

stm32f103rbt6

ߺ UART1(USB to Serial Ʈ) DB9(UART2) PC մϴ.

stm32f103rbt6

[1] UART2 test : UART2 Ʈ ͹̳ο "uart2 echo serive is started." Display ǰ
UART2 ͹̳ο Ư ڸ Էϸ ٷ Echo Ǿ ȭ鿡 Ÿ ˴ϴ.

stm32f103rbt6

4.12 RS485 ׽Ʈ

4.12.1 Dragon ߺ ̿ ׽Ʈ
RS485 ׽Ʈ ؼ Dragon ߺ尡 2Ʈ ʿ մϴ.

(1) Ʒ ׸ Dragon ߺ 2븦 RS485 ͹̳ "A" <-> "A", "B" <-> "B" մϴ.

2 ߺ忡 485_B, 485_A ũ Ǿ ִ Ʈ մϴ.

stm32f103rbt6

(2) ߺ COM1 Ʈ ̴ USB̺ մϴ.
(3) ġ ڿ ø Ʈ Ȯϰ ͹̳ α׷ մϴ.
(4) ߺ 1Ʈ "RS485 Slave test" ؼ Slave Mode մϴ.

stm32f103rbt6

(5) ߺ 1Ʈ "RS485 Master test" ؼ Master Mode 485͸ Slave Mode մϴ.

"0x61 ~ 0x73" ͸ RS485 Slave ϸ RS485 Slave 忡 ϰ ִ ߺ忡 ٽ Master ͸ մϴ.

stm32f103rbt6

4.12.2 Dragon ߺ RS485 ̿ ׽Ʈ

(1) Dragon ߺ "USB to 485" ǰ մϴ. Dragon ߺ մϴ.
RS485 ͹̳ "A" <-> "A", "B" <-> "B" մϴ. 485_B, 485_A ũ Ǿ ִ Ʈ մϴ.

USB to RS485 ϱ
stm32f103rbt6stm32f103rbt6

(2) "USB to 485" ǰ ͹̳ Baudrate ݵ 9600bps ؾ մϴ.
(3) Dragon ߺ忡 "RS485 Master test" ؼ Master Mode 485͸ Slave Mode( "USB to 485") մϴ.

stm32f103rbt6



4.13 CAN ׽Ʈ

* CAN ׽Ʈ ǻ
CAN ͷƮ USB ͷƮ Ұ մϴ.
CAN׽Ʈ ؼ ϴ ҽ hw_config.c void bsp_init_rcc(void) Լ Ʒ κ ּ ؾ մϴ.
ݴ USB ϱ ؼ Ʒ κ ּó ؾ մϴ.

RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1, ENABLE);


[1] CAN Loopback : Ʒ ޼ 켱 ü ׽Ʈ Դϴ.

stm32f103rbt6


[2] CAN Normal : CAN ׽Ʈ ϱ ؼ Dragon ߺ 2Ʈ ʿ մϴ.
2 ߺ忡 CAN_H, CAN_L ũ Ǿ ִ Ʈ մϴ.

stm32f103rbt6

(2) ߺ COM1 Ʈ ̴ USB̺ մϴ.
(3) ġ ڿ ø Ʈ Ȯϰ ͹̳ α׷ մϴ.
(4) ߺ 1Ʈ "[2] CAN Normal " ؼ CAN ͸ ۽ մϴ.

stm32f103rbt6

(5) ݴ ߺ忡 "[2] CAN Normal " ؼ CAN ͸ ۽Ű ÿ մϴ.

stm32f103rbt6

4.14 ADC ׽Ʈ

[1] ADC12 IN15 VR Input : ߺ忡 ִ (ADC_VR) ADC Է ׽Ʈ غ ֽϴ.

stm32f103rbt6

׸ ׸ ڽ ִ (ADC_VR) ¿ ϸ ͹̳ο ȭ а ǥ մϴ.

stm32f103rbt6

[2] ADC12 IN9 Input
[3] ADC12 IN8 Input : ܺο е ADC Ʈ ؼ о ݴϴ.

stm32f103rbt6

Power supply DC 2.2V ΰϿ, Ʒ ߺ忡 1.6V ǥϰ ֽϴ.
0.2 ~ 0.3 V ̰ ° ڵ ۼ STM32 AVCC ΰǴ ؼ ݿ ϸ ֽϴ.

stm32f103rbt6

4.15 DAC ׽Ʈ

[1] DAC1 Noise output : Ϻϰ ʾҽϴ.

4.16 Buzzer ׽Ʈ

[1] Buzzer Start : Buzzer Beep ︳ϴ.
[2] Buzzer Stop : Beep ߴ մϴ.

stm32f103rbt6

4.16 LCD1602 ׽Ʈ

[1] LCD1602 test : LCD1602 ʱȭ ϰ LCDȭ鿡 Text Display մϴ.

stm32f103rbt6

1602LCD Ⱑ Ӱų ʹ 쿡 LCD_VR ֽϴ. Ʒ ׸ ׸ ڽ κԴϴ.

stm32f103rbt6

 

4.17 LCD12864 ׽Ʈ

[1] LCD12864 test : LCD12864 ʱȭ ϰ LCDȭ鿡 Text Display մϴ.

stm32f103rbt6

stm32f103rbt6

12864LCD ؽƮ Ⱑ ʹ ο 쿡 Ʒ ׸ VR ̹ ̿ؼ մϴ.

stm32f103rbt6

 




5. α׷ ̵

5.1 Keil MDK 4.2x

α׷ Keil MDK Ϸ (â)

5.2 IAR Workbench 6.x

α׷ IAR Ϸ (â)

5.3 RIDE7

α׷ RIDE7 Ϸ (â)

5.4 GCC & Ŭ

α׷ Ŭ & GCC (â)