1 |
/*********************************************************************
|
2 |
*
|
3 |
* General Delay rouines
|
4 |
*
|
5 |
*********************************************************************
|
6 |
* FileName: delay.c
|
7 |
* Dependencies: compiler.h
|
8 |
* Processor: PIC18
|
9 |
* Complier: MCC18 v1.00.50 or higher
|
10 |
* HITECH PICC-18 V8.10PL1 or higher
|
11 |
* Company: Microchip Technology, Inc.
|
12 |
*
|
13 |
* Software License Agreement
|
14 |
*
|
15 |
* The software supplied herewith by Microchip Technology Incorporated
|
16 |
* (the “Company”) for its PICmicro® Microcontroller is intended and
|
17 |
* supplied to you, the Company’s customer, for use solely and
|
18 |
* exclusively on Microchip PICmicro Microcontroller products. The
|
19 |
* software is owned by the Company and/or its supplier, and is
|
20 |
* protected under applicable copyright laws. All rights are reserved.
|
21 |
* Any use in violation of the foregoing restrictions may subject the
|
22 |
* user to criminal sanctions under applicable laws, as well as to
|
23 |
* civil liability for the breach of the terms and conditions of this
|
24 |
* license.
|
25 |
*
|
26 |
* THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
|
27 |
* WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
|
28 |
* TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
29 |
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
|
30 |
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
|
31 |
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
32 |
*
|
33 |
* HiTech PICC18 Compiler Options excluding device selection:
|
34 |
* -FAKELOCAL -G -Zg -E -C
|
35 |
*
|
36 |
* Note: HITECH portions is adopted from PICC18 sample "delay.c".
|
37 |
*
|
38 |
* Author Date Comment
|
39 |
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
40 |
* Nilesh Rajbharti 5/9/02 Original (Rev 1.0)
|
41 |
********************************************************************/
|
42 |
#include "delay.h"
|
43 |
|
44 |
|
45 |
#define DUMMY
|
46 |
|
47 |
#if defined(HITECH_C18)
|
48 |
void DelayMs(unsigned char ms)
|
49 |
{
|
50 |
unsigned char i;
|
51 |
while (ms--)
|
52 |
{
|
53 |
i=4;
|
54 |
while(i--)
|
55 |
{
|
56 |
Delay10us(uS_CNT); /* Adjust for error */
|
57 |
}
|
58 |
}
|
59 |
}
|
60 |
#endif
|
61 |
|
62 |
|
63 |
|
64 |
|