Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-01

Interrupts in ARM Embedded

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juan Duran

Hi all,

I haven't been able to find a clear example on how to program on ARM with interrupts. Can somebody post an example? I am specially interested in Systick interrupts on LPC1768.

Thanks in advance

Jeppe Græsdal Johansen
to Juan Duran
Juan Duran wrote 11 lines
Hi all, I haven't been able to find a clear example on how to program on ARM with interrupts. Can somebody post an example? I am specially interested in Systick interrupts on LPC1768. Thanks in advance _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

For peripheral interrupts you'll need to set up the NVIC, but for systick(which is a common cortex-m3 core interrupt) something like this should work(I am not sure the systick initialization is perfect):

program test;
uses cortexm3;
procedure systick; public name 'SysTick_interrupt';
begin
    // code here
end;
begin
    SysTick.LOAD := 1000;
    SysTick.CTRL := 7; // Enable, Int enable, and source = HCLK
    asm
       cpsie if // enable faults and interrupts
    end;
    while true do;
end.