MICROCHIP提供的汇编源程序我不太理解,有人能帮帮忙吗?<br /><br /><br /> movf tmr0,w ; high byte of value is stored in tmr0<br /> movwf freqhi ; low value is still in the prescaler<br /> ; freqhi=tmr0<br /><br />; To get the value from the prescaler (which is not directly readable),<br />; the clock source for tmr0 is changed to Fosc/4.<br />; Next the value of tmr0 is observed. The time is takes for the next<br />; increment is an indication of the value of the prescaler.<br /><br /> movlw b'11010111' ; change clock source to Fosc/4<br /> option ;内部指令周期时钟 FOSC/4上的电平变化<br /><br />measureprescaler<br /> incf freqlo ; was initialised to 255 and set to 0 here freqlo+1=0<br /> movf tmr0,w ; get the current value of tmr0 w=tmr0<br /> xorwf freqhi,w ; compare it with the original value of tmr0 w与freqhi作逻辑异或运算<br /><br /> btfsc status,z ; did tmr0 increment? ; 测试status中的位z,为0 则跳过<br /> ;if(tmr0!=freqhi)<br /> goto measureprescaler ; no, loop and increment freqlo<br /><br />8位的定时器,他的那个计数器的高低字节是怎么算的<br /> |
|