Practice 1 Asst Prof Dr Alper MAN What

  • Slides: 9
Download presentation
Practice 1 Asst. Prof. Dr. Alper ŞİŞMAN

Practice 1 Asst. Prof. Dr. Alper ŞİŞMAN

What is STM 32 F Discovery board • STM 32 F 407 VGt 6

What is STM 32 F Discovery board • STM 32 F 407 VGt 6 MCU with 32 -bit ARM Cortex. MF 4 core, 1 MB Flash and 192 KB RAM • ST-Link debugger • External or USB power options (5 V). • 8 -LED indicators – red/green LED Indicating the communication with the computer (debugging, programming etc. ) – Red power on indicator LED – 4 general purpose LEDs (orange, green, red and blue) – 2 USB LEDs (green, red) indicating USB port of MCU active.

A reset and a general purpose button Micro USB connector for USB applications 3

A reset and a general purpose button Micro USB connector for USB applications 3 -dimension digital accelerometer (LIS 302 DL) Omni-directional MEMS microphone (MP 45 DT 02) • DAC with integrated Class-D speaker driver (CS 43 L 22) • 100 -pin header to reach all pins of the MCU • •

What is STM 32 F 407 VG MCU – Core: ARM 32 -bit Cortex™-M

What is STM 32 F 407 VG MCU – Core: ARM 32 -bit Cortex™-M 4 F CPU with FPU, Adaptive real-time accelerator (ART Accelerator™) allowing 0 -wait state execution from Flash memory, frequency up to 168 MHz, and DSP instructions – Memories • Up to 1 Mbyte of Flash memory • Up to 192+4 Kbytes of SRAM including 64 -Kbyte of CCM (core coupled memory) data RAM • Flexible static memory controller supporting Compact Flash, SRAM, PSRAM, NOR and NAND memories – LCD parallel interface, 8080/6800 modes

 • 3× 12 -bit, 2. 4 MSPS A/D converters: up to 24 channels

• 3× 12 -bit, 2. 4 MSPS A/D converters: up to 24 channels and 7. 2 MSPS in triple interleaved mode • 2× 12 -bit D/A converter • Up to 140 I/O ports with interrupt capability – Up to 15 communication interfaces – Up to 3 × I 2 C interfaces (SMBus/PMBus) – Up to 4 USARTs/2 UARTs (10. 5 Mbit/s, ISO 7816 interface, LIN, Ir. DA, modem control) – Up to 3 SPIs (37. 5 Mbits/s), 2 with muxed full-duplex I 2 S to achieve audio class accuracy via internal audio PLL or external clock – 2 × CAN interfaces (2. 0 B Active) – SDIO interface

 • Advanced connectivity – USB 2. 0 full-speed device/host/OTG controller – 10/100 Ethernet

• Advanced connectivity – USB 2. 0 full-speed device/host/OTG controller – 10/100 Ethernet MAC with dedicated DMA: supports IEEE 1588 v 2 hardware, MII/RMII – 8 - to 14 -bit parallel camera interface up to 54 Mbytes/s • Up to 17 timers: up to twelve 16 -bit and two 32 -bit timers up to 168 MHz, each with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input • Debug mode – Serial wire debug (SWD) & JTAG interfaces • Analog random number generator • CRC calculation unit, 96 -bit unique ID • RTC: subsecond accuracy, hardware calendar

Compiler • Keil STM 32 C compiler can be used. (32 K free version)

Compiler • Keil STM 32 C compiler can be used. (32 K free version) • Create a new project using project tab • Choose the MCU type (STM 32 F 407 ZG) • Add new item to source group 1: C file, the name: main • Include the processor header file: STM 32 F 4 xx. h • Each code file must have System. Init() and main() functions • Compile it.

Debugger • Set simulation mode • Activate HW floating point block in system init

Debugger • Set simulation mode • Activate HW floating point block in system init function: (*((int*)0 x. E 000 ED 88))|=0 x 0 F 00000; • Write the main code as follows: – – int sayi 1; int sayi 2=5000, sonuc; sayi 1 = sayi 2 % 3; sonuc=sayi 1+sayi 2; • Hit the debug button, add watch windows and see how the number are changing as the program executing step by step

HW Debugging • Download USB drivers from ST’s internet site. They must be installed

HW Debugging • Download USB drivers from ST’s internet site. They must be installed before. • Change the debug mode of your project to ST-link debugger (Use options menu) – Change simulation mode debugger mode (Debug menu) – Select Flash programmer as ST-debugger(Flash utilities menu) – Choose the driver for flashing (from settings button of the flash utilities menu) • Connect the discovery kit via mini USB connector • Upload the compiled the code • Execute the code step by step