Introduction
Kit MCBSTM32E introduces Cortex-M3 family, allowing you to create some simple examples to start playing around with this microcontroller. This kit has the following feautres:
- Graphical Display QVGA
- MicroSD card reader
- UART
- 4 buttons
- 8 LEDs
- Potentiometer for testing A/D
- Speaker

For programming or debugging of out Starter kit one need the JTAG Ulink (This little board connected on ST Kit)

Samples presented in this tutorial
- Blink Leds
- Using Timers
- Graphical Display and A/D
- Using RTX (Keil RTOS)
- Using RTX with Mailbox
Keil Development tool
The Keil ARM compiler integrated with the Keil IDE uVision become (IMO) the most complete development environment for ARM processors, compared to other open-source solutions. The following are most important:
- Easy Debugging
- Reduced size of generated code
- RTOS Integration (RTX)
- Integrated version control system (CVS)
The video below show how to open a Keil project
Video of the ST board alive.
Creating and debugging projects
First sample, Blink Leds
This sample show how to configure the PORT direction to output, note that in this sample we use an hand coded "delay" routine to spend some cycles.
Using Timers
Now we're going to use the timer interrupt, to create the LEDs turn-on/off time delay. In Cortex M3 the interrupt vector has fixed positions, defined in the startup file (STM32F10x.s). So all we need to do is add our interrupt routine name in the startup file, in the right positon, that whenever there is an interruption, our routine (TIM1_UP_IRQHandler) will be called automatically, our only job is to define it's code.
Our code...
Graphical Display and A/D
In this example we show the value read from A/D in the graphical display, Keil provided the libraries to work with this display. Just insert in your project the following files.
- fonts.h
- lcd.c
- lcd.h
To initiate the display
Sending some text
Now for reading the A/D it's simple, just configure the A/D hardware, and verify when the conversion ends.
Now reading the A/D conversion value
Keil RTOS (RTX)
RTX is actually a real-time embedded operating system for ARM processors, with it you can break the problem into tasks that will be executed following some rule of schedule. With an RTOS we can define:
- Tasks priority
- Alocation/Protection
- Data exchange between tasks
That's how we create a RTX project
Mailbox
The mailboxes are mechanisms which information is exchanged from one task to another.
