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.

using SysTick_Handler in an interrupt

Status
Not open for further replies.

h.galeh

Member level 3
Joined
Apr 16, 2008
Messages
66
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Tehran, Iran, Iran
Activity points
1,690
unfortunately Interrupts occur very bad . I use gpio0.0 interrupt to switch led's on and off but switching time is so little . the interrupt occurs multiple times once I connect wire to ground
to solve it I used for(0-> 1000000) but it didn't wait resolve the problem
I used SysTick_Handler too . but Wait() function was infinite time . how should I solve it . tell me whats the problem with my solutions?
Code:
#include "lpc17xx.h"
#include "gpio.h"
#include "lpc17xx_pinsel.h"
uint32_t sysTicks=0;
uint32_t m;
__irq void SysTick_Handler(){
  sysTicks++;
}
void Wait(uint32_t ms){
  uint32_t first=sysTicks;
  while((sysTicks-first)<ms);
}
__irq void EINT3_IRQHandler(){
   GPIOINT->CLR00=1;
   GPIO2->FIOPIN0=~GPIO2->FIOPIN0;
   //for(uint32_t i=0;i<100000;i++);
   Wait(10);
}
void main(){
  SystemInit();
  SystemCoreClockUpdate();
  SysTick_Config(SystemCoreClock/1000);
  GPIO2->FIODIR0=0xff;
  GPIOINT->En0R0=1;
  NVIC_EnableIRQ(EINT3_IRQn);  
  while(1){
 
  }
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top