全文预览

电子节气门控制

上传者:upcfxx |  格式:doc  |  页数:7 |  大小:0KB

文档介绍
_____________ ;__________ STEP VI: wait for interrupt or PWM flag set ______ waitloop btfss pir1,1 ;if bit =1 capture ess goto waitloop ;else wait for ess ;________________________________________________________________ ;____________ STEP VII: Clear the PWM flag __________________ bcf pir1,1 ;clear the flag incf mycount,1 incf mycount,1 incf mycount,1 incf mycount,1 incf mycount,1 incf mycount,1 incf mycount,1 incfsz mycount,1 goto waitloop ;count the pwm output number nop decfsz myduty,1 ;duty=duty-1 goto resetduty ;if duty=0, reset to the max duty movf myperiod,0 ;max duty = period movwf myduty ;save the duty pr1l ;reload pr1l goto waitloop ;prepare to the next capture resetduty movf myduty,0 ;else duty save and load pr1l pr1l goto waitloop ;continue end ………………实验结束…………………………………………………………

收藏

分享

举报
下载此文档