Introduction to LM3S6965 Kit
This kit also serves as introduction to the main features of Cortex M3, it has some attractive features compared to MCBST32E kit, for example there is no need for hardware to program/debug, only a USB cable connected to the board, to write and debug projects. We list the main features of this microcontroller.
- 50 Mhz, 256KB Flash ROM, 64KB SRAM
- Up to 9 Timers
- Hardware ETHERNET 10/100 MAC + PHY
- 3 UART
- 2 I2C Ports
- 2 Analog Comparators
- 6 PWM
- 10-bit four-channel AD
- 42 IO pins
- Temperature Sensor, WatchDog
Samples covered on this tutorial
- Blink
- Read IO
- Using timers
- Using LCD display
- Using RTX
- Using RTX mailbox
Blinking LEDs
Let's see again how to blink leds
Using LCD display
We will see how to write a simple string "Hello world" to the display. For that one has to include the Luminary drivers and point our project to Stelaris instalation directory (Normally c:\StellarisWare)
We also need to include the lcd library in the project ("C:\StellarisWare\boards\ek-lm3s6965\drivers\rit128x96x4.c"), also the Luminary general library have to be included "C:\StellarisWare\driverlib\rvmdk\driverlib.lib".
Read button state
Now we'll see how to read the value of a button connected to I/O pin. But before that we will include the headers used by the functions of GPIO Luminary driver.
- #include "lm3s6965.h"
- #include "inc/hw_memmap.h"
- #include "inc/hw_sysctl.h"
- #include "inc/hw_types.h"
- #include "driverlib/gpio.h"
- #include "driverlib/sysctl.h"
- #include "drivers/rit128x96x4.h"
As we can see the example is very simple, after setting up the LCD and the PORTF, we just have a loop by checking the status of the pins and showing the results on screen.
Using timers
We will see now how to prepare an timer interrupt. Even if the processor is doing something, it will stop, run the timer interrupt hancler and return to the point where it stopped. In Cortex M3 family interrupt vector is fixed, you just put the name of the function that will handle the interruption in the Startup.s.
Now the interrupt handler code
Using RTX
We shall see how to use the embedded operating system RTX on this board. The advantage of using one embedded operating system, is the possibility of breaking the logic in tasks.