我在公车被蹭水后当晚就来了月经,在公车上露着奶被男人玩,公车上的人妻沦陷完整版,(NP、高H、纯肉)公车,公车娇喘抽搐喷潮H文苏小暖,公车全黄H全肉短篇公车之狼

技術(shù)熱線: 4007-888-234

專注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命

提供開發(fā)工具、應(yīng)用測(cè)試 完善的開發(fā)代碼案例庫(kù)分享

從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無(wú)限潛能!

技術(shù)支持

PIC16F84單片機(jī)產(chǎn)生兩組PWM輸出實(shí)例

更新時(shí)間: 2019-03-23

十年專注單片機(jī)方案開發(fā)的方案公司英銳恩,分享PIC16F84單片機(jī)產(chǎn)生兩組PWM輸出實(shí)例。英銳恩現(xiàn)提供服務(wù)產(chǎn)品涉及主控芯片:8位單片機(jī)、16位單片機(jī)、32位單片機(jī)及各類運(yùn)算放大器等。

list p=16F84 ; list directive to define processor
#include ; processor specific variable definitions

 

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_OFF & _RC_OSC

; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.


;********************** CONST DEFINITIONS******************************
FULL_WORK = 10 ; 程
DEF_WORK2 = 8 ; PWM2
PORT_OUT = PORTB ;
PIN_PWM1 = 0 ; P
PIN_PWM2 = 1 ;
;********************** VARIABLE DEFINITIONS***************************
CBLOCK 0x0C
w_temp ; variable used for context saving
status_temp ; variable used for context saving
PWM_FULL ; 程
PWM_WORK_CFG1 ; PWM1 
PWM_WORK_CFG2 ; PWM2 

PWM_WORK_CNT1 ; PWM1 
PWM_WORK_CNT2 ; PWM2 
ENDC
;**********************************************************************
;****************** *******************
;**********************************************************************
ORG 0x000 ; processor reset vector
ResetStart
goto main ; go to beginning of program
;**********************************************************************
;**************************************
;**********************************************************************
ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register

 

bsf STATUS,RP0
bcf INTCON,T0IF ;
bcf STATUS,RP0 

decfsz PWM_FULL,F ;
goto ISR_PWM1
bsf PORT_OUT,PIN_PWM1 ; PWM1/PWM2
bsf PORT_OUT,PIN_PWM2
movlw FULL_WORK ; 
movwf PWM_FULL
movf PWM_WORK_CFG1,W
movwf PWM_WORK_CNT1
movf PWM_WORK_CFG2,W
movwf PWM_WORK_CNT2
goto ISR_EXIT
ISR_PWM1
decfsz PWM_WORK_CNT1,F ;
goto ISR_PWM2
bcf PORT_OUT,PIN_PWM1 ; 
ISR_PWM2

decfsz PWM_WORK_CNT2,F ;
goto ISR_EXIT
bcf PORT_OUT,PIN_PWM2 ; 
ISR_EXIT
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
;**********************************************************************
;****************** ﹍てPWM *******************************
;**********************************************************************
InitPWM
bsf STATUS,RP0 ;
bcf PORT_OUT,PIN_PWM1
bcf PORT_OUT,PIN_PWM2
bcf STATUS,RP0
bsf PORT_OUT,PIN_PWM1 ;
bsf PORT_OUT,PIN_PWM2
movlw FULL_WORK ;
movwf PWM_FULL
movlw DEF_WORK1

movwf PWM_WORK_CFG1
movwf PWM_WORK_CNT1
movlw DEF_WORK2
movwf PWM_WORK_CFG2
movwf PWM_WORK_CNT2
retlw 0
;**********************************************************************
;************************************************
;**********************************************************************
InitTimer
bsf STATUS,RP0
bsf OPTION_REG,T0CS ;
bsf OPTION_REG,PSA ;
bsf INTCON,GIE ;
bcf INTCON,T0IF ;
bcf STATUS,RP0
retlw 0
;********************************************************************

**
;********************
;**********************************************************************
StartTimer
bsf STATUS,RP0
bcf OPTION_REG,T0CS ;
bsf INTCON,T0IE ;
bcf STATUS,RP0
retlw 0
;**********************************************************************
;****************** *******************************
;**********************************************************************
StopTimer
bsf STATUS,RP0
bsf OPTION_REG,T0CS ;
bcf INTCON,T0IE ;
bcf STATUS,RP0
retlw 0
;**********************************************************************
;****************** *******************************

;**********************************************************************
main
bcf STATUS,RP0 ; select Page 0 for Port Access
call InitPWM
call InitTimer
call StartTimer
goto $
;**********************************************************************
END ; directive 'end of program'

404
返回首頁(yè) |  返回上一頁(yè)
福建省| 松阳县| 双流县| 安化县| 洛阳市| 剑河县| 娄底市| 阳曲县| 平谷区| 内丘县| 昭觉县| 乐至县| 克什克腾旗| 青冈县| 普安县| 乌鲁木齐县| 永和县| 土默特右旗| 海伦市| 文成县| 淮北市| 衡阳市| 富顺县| 永泰县| 玛纳斯县| 丰镇市| 梅州市| 武穴市| 津市市| 尚志市| 子洲县| 广饶县| 博客| 龙口市| 湖口县| 吐鲁番市| 承德市| 福鼎市| 渭源县| 辽宁省| 汾阳市|