Delay routines. More...
Defines | |
#define | delay_us(n) |
Delay in microseconds. | |
Functions | |
void | delay_100us (int n) |
Delay in 100 microseconds. | |
void | delay_ms (int n) |
Delay in milliseconds. | |
void | delay_s (int n) |
Delay in seconds. |
Delay routines.
Implementation of delay functionality for the Dwengo board
#define delay_us | ( | n | ) |
{ char a=n; \
_asm \
MOVLW a \
MOVF PLUSW2, 1, 0 \
BZ 12 \
DECF PLUSW2, 1, 0 \
loop: \
MOVLW a \
MOVF PLUSW2, 1, 0 \
BZ 8 \
NOP \
NOP \
NOP \
NOP \
NOP \
NOP \
DECF PLUSW2, 1, 0 \
BRA -11 \
end: \
_endasm }
Delay in microseconds.
n | number (0-255) of microseconds to wait |
void delay_100us | ( | int | n | ) |
Delay in 100 microseconds.
n | times 100 microseconds the microcontroller has to wait |
void delay_ms | ( | int | n | ) |
Delay in milliseconds.
n | number of milliseconds the program has to wait |
void delay_s | ( | int | n | ) |
Delay in seconds.
n | times seconds the microcontroller has to wait |