寻找图片的1分钟延迟 [英] looking for 1 minute delay for pic
本文介绍了寻找图片的1分钟延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
会员成员
我正在尽力将图片延迟1分钟,我正在配置设备
在启用内部振荡器和看门狗时,OPTION_REG = 10001000.
我想知道我是否还应该对行的总数进行计数并将其乘以1/64以获取所有指令所需的时间
需要您的精美评论
Hellow members
i am trying my best to delay the pic for 1 minute,i am configuring the device
at internal oscilator and watchdog enabled,the OPTION_REG=10001000.
i wonder if i should ALSO count total numbers of lines and multiply it by 1/64 to get time required for all instruction
need your fine comments
movlw b'10001000'
movwf OPTION_REG
.
.
.
movlw .1
movwf N_Minute
call DelayiM
.
.
.
DelayiM sleep
sleep
loopiiMM sleep
movlw .60
movwf Seconds
loopi2M sleep
sleep
movlw .52
movwf j
loopj2M sleep
clrwdt
decfsz j,1
goto loopj2M
decfsz Seconds,1
goto loopi2M
decfsz N_Minute,1
goto loopiiMM
return
推荐答案
我已经忘记了如何创建延迟.
但是我记得我曾经做过一些计算.
首先了解您的图片时钟速度是多少.
如果您使用的是4Mhz crysta,您将获得1Mhz时钟速度.我完全忘记了为什么.
因此,在1Mhz中,您将获得1,000,000个周期.
因此编写一个函数以获得255 * 2 + 2周期
I have forgotten how I created delay.
But I can remember that I used to do some calculation.
first learn what is your pic clock speed.
if you are using 4Mhz crysta you will get 1Mhz clock speed. I totally forgot why.
so in 1Mhz you are getting 1,000,000 cycle.
so write a function to get 255*2+2 cycle
//i forgot how to declare a function
;if you call this function with 255 data then you will get 255*2+2=512 cycle
func1 macro TIME //calling this function will give 255 cycle.
DECFSZ TIME, 1 ; this will give 255 cycle
NOP ; this will give 255 cyle
END
因此,显然您已创建了0.000512秒的延迟.您只有几步之遥,只有一秒钟的时间:)
现在,请剩下的工作……
so apparently you have created a delay of 0.000512 seconds. you are few steps away to make it one seconds :)
now please do the rest...
我认为,如果不认真看一下微控制器的文档,谁都不会知道.这是一个非常不寻常的问题,因为这里的大多数人都专门研究高级languanges.所以我想Google是您的朋友:)
I dont think anybody could know that without a serious look at the documentation form the microcontroller. THis is highly unusual question, as most people here have specialized in higher languanges. So I guess google is your friend at this one :)
这篇关于寻找图片的1分钟延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文