manual for stm32f103-db 512k board - bravekit€¦ · • connector for color 2.8 "tft lcd...
TRANSCRIPT
STM32F103-DB
STM32F103-DB development board (512K)
Users manual
STM32F103-DB Manual
www.bravekit.com Page 2
Introduction:
Development board STM32F103-DB is a universal tool to explore new ARM CORTEX-M3
microcontrollers from ST Microelectronics. The board has on board a large set of frequently used by
developers of modules and interfaces, and also has a prototype area for further expansion of the
scheme and the empowerment of the board. Firmware in the controller can be loaded via USB (has a
built-in bootloader on USART1), which makes it possible to reduce the initial costs of getting started.
As a option (not in standard set), character LCD or 2.8''color TFT LCD 262k color screen with 320x240
pixel touch screen can be added to the board.
Board features:
• MCU: STM32F103RET6 ARM 32 bit CORTEX M3™ with 512K Bytes Program Flash, 64K Bytes
RAM, USB, x2 WDT, CAN, x2 I2C, 3x I2S, x2 ADC 12 bit, x2 DAC 12 bit, x3 USART (IRDA), 2x
UART, x3 SPI, SDIO, x8 TIMERS, up to 72Mhz operation
• Large set of jumpers for flexible setup and configuration of board
• USB interface with programmable pull-resistor 1.5 KOhms on the line D +
• standard JTAG connector with ARM 2x10 pin layout for programming/debugging with ARM-
JTAG
• CAN driver and connector
• RS232 driver and connector
• USB/UART converter based on FT232RL from FTDI, connected to USART1. Firmware can be
loaded to microcontroller via this USB/UART port with ST Flash Loader Demonstrator
software. Extension headers for all port pins of FT232RL.
• UEXT connector which allow different modules with USART, I2C or SPI to be connected
• SD connector with “write protect” and “card inserted” detection
• backup battery connector
• RESET button
• power supply LED (red)
• two status LED’s
• on board voltage regulator 3.3V with up to 800mA current
• Wide range of power supply inputs:
o AC or DC via power supply jack
o from USB
o From external programmer: 3.3V via 1..2 pins of JTAG connector, or +5V via 19 pin of
JTAG connector (J-link programmer have function of supplying +5V 100mA via 19 pin
of JTAG connector )
• Connected to ADC potentiometer
• 8 MHz crystal oscillator
• 32768 Hz crystal and RTC backup battery connector
STM32F103-DB Manual
www.bravekit.com Page 3
• “Wakeup” button, “Tamper” button and two user buttons
• 16K 25LC160A EEPROM with SPI interface
• Ability to connect a standard character LCD with HD44780 controller (WH2002 type, etc.) with
the choice of its supply voltage (3.3 V/5V) and adjustable contrast
• Connector for color 2.8 "TFT LCD Display 320 * 240 pixels 262K color touch-screen module.
The board provides a fully functional operation of the display via 8-bit bus, and the work of
touch panel with control on the SPI.
• extension headers for all uC ports
• PCB: FR-4, 1.5 mm (0,062"), solder mask, silkscreen component print
• Dimensions: 123 x 91mm (4.85 x 3.5")
Processor features:
STM32F103-DB board use ARM 32-bit Cortex™-M3 CPU STM32F103RET6 from ST Microelectronics
with these features:
• CPU clock up to 72Mhz
• FLASH 512KB
• RAM 64KB
• DMA x7 channels
• RTC
• WDT x2
• Timers x8
• SPI x3
• I2S x2
• I2C x2
• USART x5
• USB x1
• SDIO
• CAN x1
• GPIO up to 51 (multiplexed with peripherals)
• 2 ADC 12-bit
• 2x DAC 12-bit
• operating voltage 2.0-3.6V
• temperature -40C +85C
STM32F103-DB Manual
www.bravekit.com Page 4
Board layout:
STM32F103-DB Manual
www.bravekit.com Page 5
Schematic:
STM32F103-DB Manual
www.bravekit.com Page 6
STM32F103xC, STM32F103xD and STM32F103xE performance line block diagram:
STM32F103-DB Manual
www.bravekit.com Page 7
Memory map:
STM32F103-DB Manual
www.bravekit.com Page 8
Power supply circuit:
STM32F103-DB can be powered from one of sources:
1. 6..12V AC or DC via power supply jack PWR (POWER_JACK1 on schematic)
2. Via USB1 or USB2 connectors. In this case JP2 (USBP_V) must be closed
3. From external programmer: 3.3V via 1..2 pins of JTAG connector, or +5V via 19 pin of JTAG
connector (J-link programmer have function of supplying +5V 100mA via 19 pin of JTAG
connector. If board powered from J-link programmer, JP26 jumper must be closed. For enabling
+5V power supply from J-link you must setup “Target power” setting in J-link control panel (see
photo below)
STM32F103-DB Manual
www.bravekit.com Page 9
Reset circuit:
STM32-P103 reset circuit is made with RC group R4 - 10K and C1 - 100nF (not installed). Although
on the schematic is made provision for external reset IC such is not necessary as STM32 have build-in
brown out detector. Manual reset is possible by the RESET button.
Clock circuit:
Quartz crystal 8Mhz is connected to STM32F103RET6. Internal PLL circuit can multiply this
frequency up to 72Mhz.
32.768 KHz quartz crystal is connected to STM32F103RET6 for it’s internal Real Time Clock.
Jumper description:
R-T: Connects JTAG TRST signal to STM32F103RET6 RESET. Default state opened.
VBAT: Connects 3.3V to STM32F103RET6 Vbat pin.1 Default state closed (shorten), Vbat signal is
also available to BAT_3V connector, so if you want to connect external backup battery to the
STM32F103RET6 this jumper should be opened (unshorted) and the external battery to be connected
to VBAT1 connector. VBAT accept 2 - 3.6V.
LED1: connect VL2 (green) to PC7 (pin #38) of STM32F103RET6 microcontroller. Default state –
closed (shorted)
LED2: connect VL3 (yellow) to PC12 (pin #53) of STM32F103RET6 microcontroller. Default state –
closed (shorted)
USBP-E: Connects USB power supply via resistive divider R1/R2 to STM32F103RET6 pin.27
PB1/ADC9 and allow to detect if the board is connected to USB host. Default state closed (shorten)
USBP_V: Connects +5V from USB to input of 3.3V power regulator and allow to power board
from USB. Default state closed (shorten)
RTS_EN (JP18): Connects PA1/USART2_RTS pin to COM port driver(ST3232). USART2_RTS
function of PA1 is used for handshake mode of COM port. Default state - open
СTS_EN (JP17): Connect PA0-WKUP/USART2_CTS pin #14 of STM32F103RET6 to COM port
driver(ST3232). By default is used Wake Up function (PA is permanent tied to Wake Up button).
Default state – open
STM32F103-DB Manual
www.bravekit.com Page 10
USB_DISC (JP5): controls pull-up of USB1 D + line to positive supply via 1.5kOhm resistor.
1 2 3
Connect PC11(pin #52) of STM32F103RET6 to USB D+ control
circuit. Log.1 on PC11 disable pull-up, thus board not detected as
USB device
Log. 0 onPC11 enable D+ pull-up, thus board is detected as USB
device.
1 2 3
Constantly pull-up D+ pull-up, thus board is always detected as
USB device.
CP: Card Present– allow PB11 (pin #30) to detect SD Card present in socket. Log. 1 of PB11 – SD
present. Log.0 of PB11 – card absent. Default state – open
WP: Write Protect Enable – allow PB10 (pin 29) to detect write protected state of SD Card. Log. 1
of PC6 – SD write protected . Log.0 of PB10 – SD is not write protected. Default state closed
(shorten)
3.3V_MCU_EN: Connect 3.3V regulated voltage to STM32F103RET6 power pins. 3.3V_MCU_E
jumper is used if you need to measure current consumption of the microcontroller. Default state
closed (shorten)
J_link 5V (JP26): connect power supply 5V 100mA from J-link external programmer. Default state
closed (shorten)
B0_H/B0_L, B1_H/B1_L: boot sequence select B1_H/B1_L (Boot1_High/Boot1_Low), B0_H/B0_L
(Boot0_High/Boot0_Low)
1 2 3
B0_H/B0_L is 0
1 2 3
B1_H/B1_L is 0
STM32F103-DB Manual
www.bravekit.com Page 11
RX1_EN: Connect PA10/USART1_RX (pin #43) of STM32F103RET6 to TX of FT232RL. Default state
closed (shorten)
TX1_EN: Connect PA9/USART1_TX (pin #42) of STM32F103RET6 to RX of FT232RL. Default state
closed (shorten)
25LC_NSS (JP11): Connect pin ~CS of EEPROM 25LC160A to PB12/SPI2_NSS (pin #33) of
STM32F103RET6 controller. Must be closed for using of 25LC160A. The 25LC160A and SD card share
same pins PB12/SPI2_NSS - you can’t use both 25LC160A and SD card on same time. Default state
opened.
25LC_MISO (JP12): Connect pin MISO of EEPROM 25LC160A to PB14/SPI2_MISO (pin #35) of
STM32F103RET6 controller. Must be closed for using of 25LC160A. The 25LC160A and SD card share
same pins PB14/SPI2_MISO - you can’t use both 25LC160A and SD card on same time. Default state
opened
CAN0_T: Connect 120 Ohm terminator between CAN_L and CAN_H busses. Default state opened.
CNTRL/HS: Allow select mode of CAN driver. Default state - opened
1 2 3
Opened: 10 KOhm resistor is connected to slope control pin of
SN65HVD230 CAN driver i.e. 15V/uS driver output signal slop.
1 2 3
CNTRL/HS is connected to HS side. High speed of output CAN
drivers (>20v/uS) – No slope control
1 2 3
CNTRL/HS is connected to CNTRL side Enable PC10(pin 51) of
STM32F103RET6 to control CAN driver modes. Log. 1 of PC10
disable CAN driver. Log. 0 of PC10enable CAN driver with high
speed mode.
STM32F103-DB Manual
www.bravekit.com Page 12
SPI1_NSS: switches CS line of SPI1 (PA4/SPI1_NSS pin #20 of STM32F103RET6) interface between
external SPI device on UEXT connector and ADS7843 touch controller for TFT LCD module
1 2 3
Connect PA4/SPI1_NSS (pin #20) of STM32F103RET6 to pin #10
of UEXT connector.
1 2 3
Connect PA4/SPI1_NSS (pin #20) of STM32F103RET6 to pin #5
of TFT LCD connector. (CS pin of ADS7843 touch screen controller
of TFT LCD module)
TFT_BL: control pin for TFT LCD backlight
1 2 3
Backlight lights always
1 2 3
Backlight is controlled by PC13 (pin #2) of STM32F103RET6.
Log. 1 on this pin turn on backlight. Log. 0 on this pin turn off
backlight.
LCD_RW (JP23): controls R/W line for character LCD
1 2 3
R/W line controlled by PC8 (pin #39) of STM32F103RET6
Log.1 enabled read mode for character LCD, log.0 enabled
write mode
1 2 3
Connect R/W line to GND, thus character LCD always work in
write mode. This is default state.
STM32F103-DB Manual
www.bravekit.com Page 13
LCD_V (JP24): Select power supply source for character LCD between 3.3V and 5V. Default state -
+5V power supply
1 2 3
Power supply of character LCD is +3.3V
1 2 3
Power supply of character LCD is +5V. This is default state.
For this mode board must be powered from USB or from J-link
programmer
JTAG:
The JTAG connector allows the software debugger to talk via a JTAG (Joint Test Action Group)
port directly to the core. Instructions may be inserted and executed by the core thus allowing
STM32F103RET6 memory to be programmed with code and executed step by step by the host
software. For more details refer to IEEE Standard 1149.1 - 1990 Standard Test Access Port and
Boundary Scan Architecture and STM32F103RET6 datasheets and users manual.
# pin. Name
# pin. Name
1 +3.3V 2 +3.3V
3 TRST: Test reset 4 GND
5 TDI: Test Data In 6 GND
7 TMS: Test Mode
Select 8 GND
9 TCK: Test Clock 10 GND
11 NC 12 GND
13 TDO: Test Data Out 14 GND
15 RST 16 GND
17 NC 18 GND
19 J-link 5V 20 GND
+3.3V: (power supply input/output): Can be used for measuring of power supply voltage on
board, or can be used as power supply source for board from external JTAG programmer
TMS ( Input): Test Mode Select. The TMS pin selects the next state in the TAP state machine.
STM32F103-DB Manual
www.bravekit.com Page 14
TCK (Input): Test Clock. This allows shifting of the data in, on the TMS and TDI pins. It is a positive
edge triggered clock with the TMS and TCK signals that define the internal state of the device.
TDI (Input): Test Data In. This is the serial data input for the shift register.
TDO (Output): Test Data Output. This is the serial data output from the shift register. Data is
shifted out of the device on the negative edge of the TCK signal.
TRST (Input): Test Reset. The TRST pin can be used to reset the test logic within the Embedded
ICE logic.
J-link 5V: via this pin board can be powered with +5V 100mA from J-link programmer. For
enabling this function JP26 jumper on board must be closed (shorted)
Connecting of LCD’s:
On STM32F103-DB can be installed character LCD (based on HD44780 controller), or 2.8'' color
262K colors 320x240 pixels TFT LCD module with touch screen
STM32F103-DB Manual
www.bravekit.com Page 15
Connecting of TFT LCD module: STM23F103-DB board have connector for 2.8’’ TFT LCD
module. Module controlled by STM32F103RET6 controller via 8-bit bus and 4 control signals. Simplest
way to connect LCD – add PLB-30 connector (see photo below). But module also can be connected with
standard 30-pin ribbon cable
STM32F103-DB Manual
www.bravekit.com Page 16
Connecting of character LCD: On STM32F103-DB board can be installed standard character
LCD with 14/16 pins in two rows, based on HD44780 controller. LCD controlled via 4-bit bus and 3
control pins. Installing a module similar to installing of TFT LCD. For contrast adjusting of LCD used
potentiometer R51
Pinout of HD44780_CON connector:
# pin Name Function
1 Vss Power supply GND
2 Vdd + of power supply (3.3/5V – selected by JP24)
3 Vo Contrast pin
4 RS Register/data select pin
5 R/W Read/write select pin
6 E Enable LCD pin
7 DB0 Data 0
8 DB1 Data 1
9 DB2 Data 2
10 DB3 Data 3
11 DB4 Data 4
12 DB5 Data 5
13 DB6 Data 6
14 DB7 Data 7
15 A_BL +3.3/5V for backlight
16 K_BL 0V for backlight
STM32F103-DB Manual
www.bravekit.com Page 17
How to load firmware into STM32F103RET6 with Flash Loader Demonstrator
software:
Firmware can be loaded into STM32F103RET6 without external programmer – via USB2
(USB/UART converter) with Flash Loader Demonstrator software. For this you must:
1. Install Flash Loader Demonstrator on your PC
2. Setup B0_H/B0_L to 1 -
1 2 3
3. Short RX1_EN, TX1_EN jumpers on STM32F103-DB board
4. Connect board to PC via USB2 port – board will be detected as Virtual Drivers you can
download from http://www.ftdichip.com/Drivers/VCP.htm
5. Run Flash Loader Demonstrator and setup software
STM32F103-DB Manual
www.bravekit.com Page 18
6. Press “Next button” – software must find 512K microcontroller
7. Press “Next” and select your microcontroller (STM32_Med-density 512K)
STM32F103-DB Manual
www.bravekit.com Page 19
8. Select operation (Erase, Download, Upload from … ) and press “Next“ Before
Downloading to flash you must firstly do “erase all” command
9. After downloading firmware to Flash press “Close” button
STM32F103-DB Manual
www.bravekit.com Page 20
10. Set B0_H/B0_L jumper to 0
1 2 3
, then reset mSTM32F103RET6 controller
with RESET button
Dimensions of board:
STM32F103-DB Manual
www.bravekit.com Page 21
App. 1: Description of 2.8” TFT LCD module
This module is 262k color 2.8 inch (320x240) TFT LCD module based on ILI9331 LCD controller
from ILITEK . The module integrated with TFT panel, IC, FPC, backlight and touch panel
ILI9331 is a 262144-color one-chip SoC driver for a TFT liquid crystal display with resolution
240RGBx320 dots, comprising a 720-chanel source driver, a 320-channel gate driver, 172800 bytes
RAM for graphic data of 240RGBx320 dots, and power supply circuit
ILI9331 has many kinds of system interfaces, but this module only realize i80-system MPU
interface (8/16bit bus width) which is widely used in embedded system
The touch panel is 4-wire analog resistive type, the module use XPT2046 touch screen controller
which is fully compatible with ADS7843 and output 8/12 bit resolution digital data in SPI interface
STM32F103-DB Manual
www.bravekit.com Page 22
TFT LCD module schematic:
STM32F103-DB Manual
www.bravekit.com Page 23
Pin definition of TFT LCD module:
# pin. Name Type Description
1 VCC Power Power supply 3.3V
2 GND Ground Power ground
3 TP_SCK Input Touch screen controller SPI Interface SCK
4 TP_MISO Output Touch screen controller SPI Interface MISO
5 TP_CS Input Touch screen controller SPI Interface SS
6 TP_MOSI Input Touch screen controller SPI Interface MOSI
7 TP_INT Output Touch screen controller SPI Interface PENIRQ
8 LCD_RST Input RESET for ILI9331
9 D15 Input / Output Data bus D15 for 16-bit mode, D7 for 8-bit mode
10 D14 Input / Output Data bus D14 for 16-bit mode, D6 for 8-bit mode
11 D13 Input / Output Data bus D13 for 16-bit mode, D5 for 8-bit mode
12 D12 Input / Output Data bus D12 for 16-bit mode, D4 for 8-bit mode
13 D11 Input / Output Data bus D11 for 16-bit mode, D3 for 8-bit mode
14 D10 Input / Output Data bus D10 for 16-bit mode, D2 for 8-bit mode
15 D9 Input / Output Data bus D9 for 16-bit mode, D1 for 8-bit mode
16 D8 Input / Output Data bus D8 for 16-bit mode, D0 for 8-bit mode
17 D7 Input / Output Data bus D7 for 16-bit mode
18 D6 Input / Output Data bus D6 for 16-bit mode
19 D5 Input / Output Data bus D5 for 16-bit mode
20 D4 Input / Output Data bus D4 for 16-bit mode
21 D3 Input / Output Data bus D3 for 16-bit mode
22 D2 Input / Output Data bus D2 for 16-bit mode
23 D1 Input / Output Data bus D1 for 16-bit mode
24 D0 Input / Output Data bus D0 for 16-bit mode
25 LCD_WR Input Bus write, active low
26 LCD_CS Input Bus Chip select, active low
27 LCD_RD Input Bus Read, active low
28 LCD_RS Input Bus data or command select signal
29 BL_K Input Backlight enable, active high
30 GND Ground Power ground