M
M
Misha Shevchuk2015-05-24 15:52:45
Microcontrollers
Misha Shevchuk, 2015-05-24 15:52:45

How to set a delay of 95ms?

org 0

ljmp start

delay_100ms:
mov r2,#250
m2:
mov r0,#250
m0:
mov r1,#199
m1:
djnz r1,m1
djnz r0,m0
djnz r2,m2
ret


start:

mov P1,#00011111b

cycle:
jnb p1.4, no_blink
cpl p1.7
no_blink:
call delay_100ms

jmp cycle


end

there is an example in which the delay is 100ms, how to make the delay 95ms.. and please explain how this program works

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-05-24
@NeiroNx

The delay must be set via a timer-counter. The necessary timer divider is set and the counter shows the number of intervals. You need to read the documentation for the corresponding microcontroller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question