Elimathew
Member level 5
- Joined
- Jun 21, 2011
- Messages
- 88
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- India
- Activity points
- 1,894
hey i am using systic timer to blink a led my core frequency is 100mhz so typically between 2 interrupts there is 1ms accordingly i have to tried to blink led but to no avail am i missing something
Code:
#include "LPC17xx.h"
#include <stdint.h>
volatile uint32_t msTicks = 0;
volatile uint32_t curTicks;
void SysTick_Handler(void)
{
msTicks++;
}
void Delay (unsigned long dlyTicks)
{
curTicks = msTicks;
while ((msTicks - curTicks) < dlyTicks);
}
int main (void)
{
SystemInit();
SysTick_Config(SystemCoreClock / 1000);
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);
}
}