hello i have found following code to make a delay in my micro but i can not understand some of the sentences i am not professional does any one friend help me? what is the meaning of {unit32_t},{__INLINE static void Delay (uint32_t dlyTicks)}
#include "LPC17xx.h" volatile uint32_t msTicks; /* counts 1ms timeTicks */ void SysTick_Handler(void) { msTicks++; /* increment counter necessary in Delay() */ } __INLINE static void Delay (uint32_t dlyTicks) { uint32_t curTicks;
curTicks = msTicks ; while ((msTicks - curTicks) < dlyTicks) ; } tnx
unit32_t doesn't mean anything. You need to be careful with the spelling of computer symbols.
uint32_t is a data type for an unsigned integer with a size suitable to store a 32-bit value. Google would have found this answer if you had tried. It would also have told you which header file you need to include.
Google also help with the concept of inline functions.
The delay function itself assumes an interrupt handler will update a global variable every one ms. So a delay of x milliseconds can then be created by waiting for the global variable to be incremented x times. This of course ignores the fact that the delay may be up to one sample off, since the increment isn's synchronized with the start of the delay loop.
tnx for your answer du you know, if i want to sampling in each micro second instead of mili second, which function is usable in LPC1768?
The timers can operate at a number of MHz. If run at 10 MHz, each tick would represent 0.1 us.
But haven't you looked at the processor documentation? Don't you think the rich documentation released by NXP is the best source of information?