Keil™, An ARM® Company

MCBSTM32 User's Guide

BLINKY

The BLINKY example program toggles the LEDs on GPIO1 and prints the converted A-to-D value to the serial port. The toggle speed of the LEDs depend on the input voltage of the ADC1 input.

The BLINKY example project demonstrates assembling, compiling, linking, downloading, and debugging using the µVision IDE on the MCBSTM32 board. The on-board LEDs make it easy to visually verify that the program loads and executes properly. The HyperTerm terminal emulator program makes it easy to verify serial output.

Loading BLINKY

To load the BLINKY project, select Open Project from the Project menu and open BLINKY.UV2 from the following folder:

  • \KEIL\ARM\BOARDS\KEIL\MCBSTM32\BLINKY\

Open Project dialog

Project Workspace When the BLINKY project opens, the µVision Project Workspace window displays the source files that make up the project.

  • STM32F10x.c contains the CPU startup code for the STMicroelectronics STM32F10x devices.
  • IRQ.c contains the target-dependent interrupt functions for the Timer and A/D converter.
  • Retarget.c configures the target-dependent low level functions for character I/O.
  • Setup.c and Blinky.c contain the application modules that monitors analog input, provides the text output, and toggles the LEDs.
  • STM32F10xR.LIB, contains the ST Software Library functions.
  • LCD_4bit.c, contains the functions to produce text for the LCD display.
  • Serial.c, contains the functions to communicate to the serial port.

The Abstract.txt file contains documentation about the project.

Editing BLINKY

You may edit Blinky.c or review the source code. Double click on Blinky.c in the Files page of the Project Workspace window. µVision loads and displays the contents of Blinky.c in an editor window.

Running BLINKY

Perform the following four steps to run the BLINKY Example on the MCBSTM32 Evaluation Board:

  1. Building BLINKY
  2. Downloading BLINKY
  3. Debugging BLINKY
  4. Checking Serial Output