Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

systic timer problem???

Status
Not open for further replies.

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);
}
	



}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top