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