senthil_99
Newbie level 6
- Joined
- Aug 8, 2012
- Messages
- 12
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,343
could any one say , how calculate 10 milli sec delay using timer in lpc2129
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
A read the datasheer recommendation doesn't really reply the question.
Tahmid, have you used any LPC2xxx microcontroller (ARM7TDMI)?
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 /***************************************************************************** ** Function name: delayMs ** ** Descriptions: Start the timer delay in milo seconds ** until elapsed ** ** parameters: timer number, Delay value in milo second ** ** Returned value: None ** *****************************************************************************/ void delayMs(BYTE timer_num, DWORD delayInMs) { if ( timer_num == 0 ) { /* * setup timer #0 for delay */ T0TCR = 0x02; /* reset timer */ T0PR = 0x00; /* set prescaler to zero */ T0MR0 = delayInMs * (Fpclk / 1000-1); T0IR = 0xff; /* reset all interrrupts */ T0MCR = 0x04; /* stop timer on match */ T0TCR = 0x01; /* start timer */ /* wait until delay time has elapsed */ while (T0TCR & 0x01); } else if ( timer_num == 1 ) { /* * setup timer #1 for delay */ T1TCR = 0x02; /* reset timer */ T1PR = 0x00; /* set prescaler to zero */ T1MR0 = delayInMs * (Fpclk / 1000-1); T1IR = 0xff; /* reset all interrrupts */ T1MCR = 0x04; /* stop timer on match */ T1TCR = 0x01; /* start timer */ /* wait until delay time has elapsed */ while (T1TCR & 0x01); } return;