Embedded Freaks..

August 10, 2009

Cortex-M3 SysTick peripheral

Filed under: Cortex-M — Tags: — kunilkuda @ 5:10 pm

The interesting part of Cortex-M3 is SysTick, an additional timer, provided by ARM, to switch the process context on RTOS. ARM was hoping that by using SysTick, most of RTOS will be portable from vendor to vendors.

But I’m a bit curious on how to use it. Hence, here’s the simple demo on how to use SysTick on Cortex-M3. (more…)

August 9, 2009

Cortex-M3 Blinky in Assembly

Filed under: Cortex-M — Tags: — kunilkuda @ 12:02 am

As tradition for new comers, I created my own ‘hello world’ using Cortex-M3’s assembly using Codesourcery’s GCC assembler. The code below has been tested on LPC1766 – Keil’s MCB1700 board. It will turn on/off the LEDs on the board.

Here’s the code: (more…)

August 7, 2009

Cortex-M3 Interrupt Vector Table

Filed under: Cortex-M — Tags: — kunilkuda @ 12:00 am

In Cortex-M3, there are 255 interrupt vectors, and it’s relocateable. During the initial boot, the interrupt vector table are located at 0×00, but, then, if you want to, you can move it to somewhere else.

The first ten interrupts are fixed by ARM (means you will always find them eventhough you’re using NXP, Atmel, STMicro, Luminary Micro, etc). The rest is up to the silicon vendors implementation.

The interrupt handler is a bit different from any other MCUs. You just need to write the interrupt handler address, without any additional code (such as: B <interrupt_handler_addr> to jump to specific address). Also, the first thing on your interrupt table is the stack address. The Cortex-M3 interrupt controller (NVIC) will need stack address before it can jump to the handler. Hence, it’s put as the first thing on the interrupt table.

Here’s how to implement it (more…)

« Newer PostsOlder Posts »

Blog at WordPress.com.