lpcware

interrupts dont seem to work at all

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Elimathew on Sun Mar 16 09:12:21 MST 2014
hi guys writing a simple program to blink a led for every 500ms using a systic timer i have observed the interrupt never occurs led stays on forever not only this but i have used many working sample programs involving interrupts but it doesnt work . Im using lpc1768(100mhz) with bootloader(factory installed) residing at 0x00000000 to 0x00002000 like is there a need to offset the vector table manually or the booloader does that by itself my application starts at 0x00002000 i have done that accordingly in keil heres the code for the systic timer

#include "LPC17xx.h"

volatile uint32_t msTicks = 0;

void SysTick_Handler(void)

{

msTicks++;//count no of ms

}

void Delay (uint32_t dlyTicks)

{
volatile uint32_t curTicks;
curTicks = msTicks;

while ((msTicks - curTicks) < dlyTicks);//stay here until delay is acheived

}

int main (void)
{ SystemInit();//core speed 100mhz

SysTick_Config(SystemCoreClock/1000);//configuring systic timer to interrupt every 1ms

LPC_SC->PCONP |= ( 1 << 15 ); // power up GPIO
LPC_GPIO1->FIODIR |= 1 << 29; // puts P1.29 into output mode.
while(1)
{

LPC_GPIO1->FIOPIN |= 1 << 29; // make P1.29 high
Delay(500);
LPC_GPIO1->FIOPIN &= ~( 1 << 29 ); // make P1.29 low
Delay(500);
}}

Outcomes