'HELP ME in THIS Delay routine'
Muqtar Mohamed Usuf
How for example to go about it in my MAIN before calling this
routine(bellow). 1/2 a second delay routine( I guest 1:64 scaler
must be set).
IF u can spare time. Try before making me go crazy please
tmr0 equ 0x1
status equ 0x3
work equ 0h
Bad Boy from ell
Muqtar Mohamed Usuf wrote:
> How for example to go about it in my MAIN before calling this
> routine(bellow). 1/2 a second delay routine( I guest 1:64 scaler
> must be set).
You should be using the .INC file to match your particular chip, not
define your own constants. This allows others to follow your code
You should also state which PIC chip you are using, and you MUST state
your clock speed. 14-bit core chips such as the 16F84 have a timer
overflow flag which simplifies the procedure greatly.
At 4 MHZ crystal, with prescale by 256, the timer increments each
256µs and rolls over each 65536µs. You need about 7¸ of these to time
a half second, so you might want to load the timer with a suitable value
and count eight rollovers.
The code you post would delay about 65ms with a 256 prescale, 16ms
with a 64 prescale. Is that what you found?
> xorwf tmr0,work
That's a long way to do:
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- New search...