GigaDevice Semiconductor Inc.
GD32VF103R-START评估板
用户指南 V1.1
用户指南
GD32VF103R-START
目录
目录 .................................................................................................................................. 1 图 ..................................................................................................................................... 3 表 ..................................................................................................................................... 4 1. 简介............................................................................................................................ 5 2. 功能引脚分配 ............................................................................................................. 5 3. 入门指南 .................................................................................................................... 5 4. 硬件设计概述 ............................................................................................................. 6
4.1. 供电电源 ........................................................................................................................ 6 4.2. 启动方式选择 ................................................................................................................. 6 4.3. LED指示灯.................................................................................................................... 6 4.4. 按键 ............................................................................................................................... 7 4.5. USBFS .......................................................................................................................... 7 4.6. GD-Link ........................................................................................................................ 8 4.7. 扩展电路 ........................................................................................................................ 8 4.8. MCU .............................................................................................................................. 9 4.9. Ardunio ......................................................................................................................... 9
5. 例程使用指南 ........................................................................................................... 10
5.1. GPIO流水灯 ................................................................................................................ 10
5.1.1. DEMO目的 ......................................................................................................................... 10 5.1.2. DEMO执行结果 .................................................................................................................. 10 5.2. GPIO按键轮询模式 ..................................................................................................... 10 5.2.1. DEMO目的 ......................................................................................................................... 10 5.2.2. DEMO执行结果 .................................................................................................................. 10 5.3. EXTI按键中断模式 ...................................................................................................... 10 5.3.1. DEMO目的 ......................................................................................................................... 10 5.3.2. DEMO执行结果 ................................................................................................................... 11 5.4. TIMER和按键触发外部中断 ........................................................................................ 11 5.4.1. DEMO目的 .......................................................................................................................... 11 5.4.2. DEMO执行结果 ................................................................................................................... 11 5.5. USBFS设备 ................................................................................................................ 11 5.5.1. 虚拟串口设备 ....................................................................................................................... 11 5.5.2. U盘设备 .............................................................................................................................. 12 5.6. USBFS主机 ................................................................................................................ 13
1
用户指南
GD32VF103R-START
5.6.1. U盘主机 .............................................................................................................................. 13
6. 版本历史 .................................................................................................................. 14
2
用户指南
GD32VF103R-START
图 图 4-1 供电电源原理图 ................................................................................................................................. 6 图 4-2 启动方式选择原理图 .......................................................................................................................... 6 图 4-3 LED功能原理图 ................................................................................................................................. 6 图 4-4 按键功能原理图 ................................................................................................................................. 7 图 4-5 USBFS原理图 ................................................................................................................................... 7 图 4-6 GD-Link原理图 ................................................................................................................................. 8 图 4-7 扩展电路功能原理图 .......................................................................................................................... 8 图 4-8 MCU原理图 ....................................................................................................................................... 9 图 4-9 Ardunio原理图.................................................................................................................................. 9
3
用户指南
GD32VF103R-START
表
表 2-1 引脚分配 ............................................................................................................................................ 5 表 6-1 版本历史 .......................................................................................................................................... 14
4
用户指南
GD32VF103R-START
1. 简介
GD32VF103R-START评估板使用GD32VF103RBT6作为主控制器。评估板使用Mini USB接口提供5V电源。提供包括扩展引脚在内的及Reset, Boot, User key, LED, GD-Link, Ardunio等外设资源。
2. 功能引脚分配
表 2-1 引脚分配
功能 引脚 PA7 LED PA8 PA10 PC13 RESET KEY PA0 PA11 USB PA12 PA9 描述 LED1 LED2 LED3 LED4 K1-Reset K2-User key USB_DM USB_DP USB_VBUS 3. 入门指南
评估板使用Mini USB提供5V电源。下载程序到评估板需要使用GD-Link工具,在选择了正确的启动方式并且上电后,LEDPWR将被点亮,表明评估板供电正常。 所有例程都是基于eclipse 4.7.2创建的。在进行调试下载前注意配置“Debug Configurations”。
5
用户指南
GD32VF103R-START
4. 4.1.
硬件设计概述 供电电源
图 4-1 供电电源原理图
CN1123VCC+5V+U5VGND+3V353214SW1S2SS1SW-SPDTDC-10B+5V+5V0U2LM1117-3.316V/10uF,AVX32VinVout4E1SMD1210P005TFC17P1G50V/0.1uF16V/10uF,AVXR7470ΩLEDPWRLED0603E2C1850V/0.1uF1 4.2. 启动方式选择
图 4-2 启动方式选择原理图
JP2321BOOT0JP3GNDR4+3V310KΩBOOT0321BOOT1GNDR5+3V310KΩPB2 4.3. LED指示灯
图 4-3 LED功能原理图
LEDPA7R1LED1LED0603LED2470ΩPA8R2470ΩPA10R8470ΩLED0603LED3LED0603LED4LED0603GNDPC13R10470Ω 6
用户指南
GD32VF103R-START
4.4. 按键
图 4-4 按键功能原理图
KEY+3V3K2K-1102BPA0C1450V/0.01uFGNDR1110KΩ 4.5. USBFS
图 4-5 USBFS原理图
+5VR5447KΩ2PC9R55470R1Q1S85503+U5VE1016V/10uF,AVXC4850V/0.1uFGNDGNDC4950V/4700pFShieldR62Mini_USB1MΩ6USB_MiniAB receptaclePA9PA11PA12USB_VBUSUSB_DMR58USB_DPR5922R22R12345CN2VBUSDMDPIDGND 7
用户指南
GD32VF103R-START
4.6. GD-Link
图 4-6 GD-Link原理图
MCU SWD+3V3JP100L_SWDIOL_SWDCK12344×1P2.54L_TMS/IOL_TCK/CLKL_TDO/SWOL_TDIL_USB_Ctr10111213141516172930313233343738U0PA0-WKUPPA1PA2PA3PA4PA5PA6PA7PA8PA9PA10PA11PA12PA13/JTMS/SWDIOPA14/JTCK/SWCLKPA15/JTDIPB0PB1PB2/BOOT1PB3/JTDOPB4/JNTRSTPB5PB6PB7PB8PB9PB10PB11PB12PB13PB14PB1518192039404142434546212225262728L_TResetGNDReset+3V3C10049SMD-8MHzY101L_USB_DML_USB_DPL_SWDIOL_SWDCKL_LED1LED0603470Ω470ΩGNDL_LED1R109L_LED2R110L_LED2LED0603L_OSC_IN5L_OSC_OUT6R10444OSC_IN/PD0OSC_OUT/PD1BOOT0NRSTVBATL_OSC_INR1011MΩL_OSC_OUTGND50V/20pFC102R10210KΩL_NRSTC10350V/0.1uF2PC13-TAMPER-RTC3PC14-OSC32_IN4PC15-OSC32_OUTGND10KΩL_NRST7150V/20pFGND2436489VDD_1VDD_2VDD_3VDDAVSS_1VSS_2VSS_3VSSA2335478GND+3V3GD32F103C8T6CN100VCCD-D+IDGNDSHELL123456+U5VR105R106R107GND22RL_USB_DM22RL_USB_DP1.5KΩL_USB_CtrC105+3V3C106C107C108Mini_USB50V/0.1uF50V/0.1uF50V/0.1uF50V/0.1uFR1081MΩC10450V/4700pFGNDGND 4.7. 扩展电路
图 4-7 扩展电路功能原理图
Extension PinPC0PC1PC2PC3PC4PC5JP1123456HEADER 6 8
用户指南
GD32VF103R-START
4.8. MCU
图 4-8 MCU原理图
PA0PA1PA2PA3PA4PA5PA6PA7PA8PA9PA10PA11PA12PA13PA14PA15U1PA0-WKUPPA1PA2PA3PA4PA5PA6PA7PB0PB1PB2/BOOT1PB3/JTDOPB4/JNTRSTPB5PB6PB71415161720212223414243444546495026272855565758596162293033343536PB0PB1PB2PB3PB4PB5PB6PB7PB8PB9PB10PB11PB12PB13PB14PB15PA8PA9PA10PA11PA12PA13/JTMSPA14/JTCKPA15/JTDIOSC_IN/PD0OSC_OUT/PD1PD2BOOT0NRSTPB8PB9PB10PB11PB12PB13PB14PB15PC0PC1PC2PC3PC4PC5PC6PC7OSC_IN5OSC_OUT6PD254BOOT0NRST60789101124253738PC0PC1PC2PC3PC4PC5PC6PC7PC8PC9PC10PC11PC12PC13PC14PC1513248641913VBATVDD_1VDD_2VDD_3VDD_439PC840PC951PC1052PC1153PC122PC13-TAMPER-RTC3PC14-OSC32_IN4PC15-OSC32_OUTVSS_1VSS_2VSS_3VSS_43147631812VDDAGD32VF103RBT6VSSA+3V3GND 4.9. Ardunio
图 4-9 Ardunio原理图
ArdunioJP810987654321D15-SCL1PB10D14-SDA1PB11D13D12D11~D10~D9~D8PB13PB14PB15PB12PB0PB1JP6NRST+3V3+3V3+5V0+5V012345678HEADER 8JP7123456HEADER 6HEADER 10JP987654321HEADER 8PA1PA2PA3PA4PA5PA6A1A2A3A4A5A6D7D6~D5~D4D3~D2D1-TxD0-RxPB9PB8PB7PB6PB5PB4PC10PC11 9
用户指南
GD32VF103R-START
5. 5.1.
5.1.1.
例程使用指南 GPIO流水灯
DEMO目的
这个例程包括了GD32 MCU的以下功能: 学习使用GPIO控制LED
学习使用SysTick产生1ms 的延时
GD32VF103R-START开发板上有4个LED。LED1, LED2, LED3和LED4通过GPIO控制着。这个例程将讲述怎么点亮LED。
5.1.2. DEMO执行结果
下载程序< 01_GPIO_Running_LED >到开发板上,LED1, LED2, LED3和LED4将顺序每间隔1秒点亮然后熄灭,一直重复这个过程。
5.2.
5.2.1.
GPIO按键轮询模式
DEMO目的
这个例程包括了GD32 MCU的以下功能: 学习使用GPIO控制LED和按键 学习使用SysTick产生1ms 的延时
GD32VF103R-START开发板有两个按键和四个LED。其中,两个按键是Reset按键和User按键;LED1, LED2, LED3和LED4可通过GPIO控制。
这个例程讲述如何使用User按键控制LED1。当按下User按键,将检测IO 端口的输入值,如果输入为高电平,将等待延时50ms。之后,再次检测IO 端口的输入状态。如果输入仍然为高电平,表明按键成功按下,翻转LED1的输出状态。
5.2.2. DEMO执行结果
下载程序< 02_GPIO_Key_Polling_mode >到开发板上,首先,所有的灯会亮灭一次用于测试,按下User按键,LED1将会点亮,再次按下User按键,LED1将会熄灭。
5.3.
5.3.1.
EXTI按键中断模式
DEMO目的
这个例程包括了GD32 MCU的以下功能:
10
用户指南
GD32VF103R-START
学习使用GPIO控制LED和按键 学习使用EXTI 产生外部中断
GD32VF103R-START开发板有两个按键和四个LED。其中,两个按键是Reset按键和User按键;LED1, LED2, LED3和LED4可通过GPIO控制。
这个例程讲述如何使用EXTI外部中断线控制LED1。当按下User按键,将产生一个外部中断,在中断服务函数中,应用程序翻转LED1的输出状态。
5.3.2. DEMO执行结果
下载程序< 03_EXTI_Key_Interrupt_mode >到开发板,首先,所有的灯会亮灭一次用于测试,然后点亮LED1,按下User按键,LED1将会点亮,再次按下User按键,LED1将会熄灭。
5.4.
5.4.1.
TIMER和按键触发外部中断
DEMO目的
这个例程包括了GD32 MCU的以下功能: 学习使用GPIO控制LED和按键 学习使用EXTI 产生外部中断 学习使用TIMER产生PWM
GD32VF103R-START开发板有两个按键和四个LED。其中,两个按键是Reset按键和User按键;LED1, LED2, LED3和LED4可通过GPIO控制。
这个例程讲述如何使用TIMER生成PWM产生外部中断然后在中断服务程序中翻转LED2的输出状态,以及如何使用EXTI外部中断线控制LED1。当按下User按键,将产生一个外部中断,在中断服务函数中,应用程序翻转LED1的输出状态。
5.4.2. DEMO执行结果
下载程序< 04_TIMER_Key_EXTI >到开发板,首先,LED1和LED2会闪烁一次用于测试,按下User按键,LED1将会点亮,再次按下User按键,LED1将会熄灭。使用杜邦线连接PA6(TIMER2_CH0)和PB11,LED2的输出状态会每隔500ms翻转一下。
5.5.
5.5.1.
USBFS设备
虚拟串口设备 DEMO目的
这个例程包括了GD32 MCU的以下功能: 学习如何使用USBFS设备
11
用户指南
GD32VF103R-START
学习如何实现USBFS CDC设备
开发板具有一个USBFS接口。在本例程中,开发板被USB主机枚举为一个USB虚拟串口,如下图所示,可在PC端设备管理器中看到该虚拟串口。该例程使得USB 键盘看起来像是个串口,也可以通过USB口回传数据。通过键盘输入某些信息,虚拟串口可以接收并显示这些信息。
DEMO执行结果
将<05_USBFS\\Device\\CDC_ACM>例程下载到开发板中,并运行。通过键盘输入某些数据,虚拟串口可以接收并显示这些数据。比如通过虚拟串口的输入框输入“GigaDevice MCU”, PC回传这些信息给虚拟串口,并得以显示。
5.5.2. U盘设备 DEMO目的
这个例程包括了GD32 MCU的以下功能: 学习如何使用USBFS
学习如何实现USB MSC(大容量存储)设备
本DEMO主要实现了一个U盘。U盘是现今非常普遍的可移动MSC类设备。MSC,即Mass Storage device Class(大容量存储设备类),是一种计算机和移动设备之间的传输协议,它允许一个通用串行总线(USB)设备来访问主机的计算设备,使两者之间进行文件传输,主要包括移动硬盘、移动光驱和U盘等。MSC类设备必须有存储介质,DEMO中使用了MCU的内部FLASH作为存储介质。具体的MSC 类协议内容请自行查阅与参考其协议标准。
MSC类设备会使用多种传输协议与命令格式进行通信,所以在实现时需要自行选择合适的协议与命令格式。本DEMO中选择BOT(仅批量传输)协议和所需的SCSI(小型计算机接口)命令,并和多种Window操作系统兼容。具体的BOT协议内容与SCSI命令规格请自行查阅与参考其协议标准。
DEMO执行结果
12
用户指南
GD32VF103R-START
下载<05_USBFS\\Device\\MSC >到开发板中并运行。当开发板连到PC后,可以在计算机的设备管理器中看到通用串行总线控制器里面多出了一个USB大容量存储设备,同时看到磁盘驱动器里面多了1个磁盘驱动器,如下所示:
接着,打开资源管理器后会看到里面多了1个磁盘,如下图所示:
此时,写/读/格式化操作可以像其他移动设备一样进行。
5.6.
5.6.1.
USBFS主机
U盘主机 DEMO目的
这个例程包括了GD32 MCU的以下功能: 学习使用USBFS作为MSC主机 学习MSC主机和U盘之间的操作
评估板包含USBFS模块,并且该模块可以被用于作为一个USB设备、一个USB主机或一个OTG设备。本示例主要显示如何使用USBFS作为一个USB MSC主机来与外部U盘进行通信。
DEMO执行结果
将OTG电缆线插入到USB接口,将< 05_USBFS\\Host\\MSC >工程下载到开发板中并运行。
如果一个U盘被连入,用户将会看到LED4点亮,表明U盘成功连接,并且LED2慢速闪烁,表明U盘已被成功枚举。按下User按键将会看到LED2快速闪烁,表明主机已经识别U盘;之后再次按下User按键将会看到LED2慢速闪烁,此时表明U盘的内容已经被正确读取;然后第三次按下User按键将会向U盘写入文件;最后用户将会看到LED1和LED2同时点亮,表明MSC主机示例结束。最后拔掉U盘,可以看到LED4熄灭。
13
用户指南
GD32VF103R-START
6. 版本历史
表 6-1 版本历史
版本号. 1.0 1.1 说明 初稿发布 修改5.5和5.6章节标题 日期 2019年06月05日 2019年09月18日
14
用户指南
GD32VF103R-START
Important Notice
This document is the property of GigaDevice Semiconductor Inc. and its subsidiaries (the \"Company\"). This document, including any product of the Company described in this document (the “Product”), is owned by the Company under the intellectual property laws and treaties of the People’s Republic of China and other jurisdictions worldwide. The Company reserves all rights under such laws and treaties and does not grant any license under its patents, copyrights, trademarks, or other intellectual property rights. The names and brands of third party referred thereto (if any) are the property of their respective owner and referred to for identification purposes only. The Company makes no warranty of any kind, express or implied, with regard to this document or any Product, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The Company does not assume any liability arising out of the application or use of any Product described in this document. Any information provided in this document is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Except for customized products which has been expressly identified in the applicable agreement, the Products are designed, developed, and/or manufactured for ordinary business, industrial, personal, and/or household applications only. The Products are not designed, intended, or authorized for use as components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, atomic energy control instruments, combustion control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where the failure of the device or Product could cause personal injury, death, property or environmental damage (\"Unintended Uses\"). Customers shall take any and all actions to ensure using and selling the Products in accordance with the applicable laws and regulations. The Company is not liable, in whole or in part, and customers shall and hereby do release the Company as well as it’s suppliers and/or distributors from any claim, damage, or other liability arising from or related to all Unintended Uses of the Products. Customers shall indemnify and hold the Company as well as it’s suppliers and/or distributors harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of the Products.
Information in this document is provided solely in connection with the Products. The Company reserves the right to make changes, corrections, modifications or improvements to this document and Products and services described herein at any time, without notice.
© 2019 GigaDevice – All rights reserved
15
因篇幅问题不能全部显示,请点此查看更多更全内容