亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? pwm_output.asm

?? PWM控制源程序
?? ASM
字號(hào):
;*******************************************************************************
; FILENAME	: PWM_Output.ASM
; AUTHOR	: SONiX
; PURPOSE	: PWM test
;		  1. Setup PWM0/PWM1 output from TC0/TC1 to PWM0OUT(P5.4)/PWM1OUT(P5.3).
;		  2. The external high-speed clock is 4MHz. The duty of PWM is 30/256. 
;		  3. The PWM frequency is about 1KHz. 
;		  4. The PWM clock source is from crystal oscillator clock.
;		  5. TC0/TC1 rate is Fcpu/4. 
;		  6. TC0RATE[2:0]=110, TC1RATE[2:0]=110, TC0C=TC0R=30, TC1C=TC1R=30.
; REVISION	: 28/01/2003 V1.0	First issue
;*******************************************************************************
;*  (c) Copyright 2003, SONiX TECHNOLOGY CO., LTD.
;*******************************************************************************
CHIP	SN8P1708					; Select the CHIP
//{{SONIX_CODE_OPTION
	.Code_Option	OSG		Enable
	.Code_Option	High_Clk	4M_X'tal
	.Code_Option	High_Clk/2	Disable
	.Code_Option	Security	Enable
	.Code_Option	LVD		Enable
	.Code_Option	Watch_Dog	Enable
//}}SONIX_CODE_OPTION


;-------------------------------------------------------------------------------
;			Include Files
;-------------------------------------------------------------------------------
.nolist							; do not list the macro file

	INCLUDESTD	MACRO1.H
	INCLUDESTD	MACRO2.H
	INCLUDESTD	MACRO3.H

.list							; Enable the listing function

;-------------------------------------------------------------------------------
;			Constants Definition
;-------------------------------------------------------------------------------
;	ONE			EQU		1

;-------------------------------------------------------------------------------
;			Variables Definition
;-------------------------------------------------------------------------------
.DATA

	org	0h				;Bank 0 data section start from RAM address 0x000
	Wk00B0		DS	1		;Temporary buffer for main loop
	Iwk00B0		DS	1		;Temporary buffer for ISR
	AccBuf		DS	1		;Accumulater buffer
	PflagBuf	DS	1		;PFLAG buffer

	org	100h				;Bank 1 data section start from RAM address 0x100
	BufB1		DS	20		;Temporary buffer in bank 1

;-------------------------------------------------------------------------------
;			Bit Flag Definition
;-------------------------------------------------------------------------------
	Wk00B0_0    	EQU	Wk00B0.0    	;Bit 0 of Wk00B0
	Iwk00B0_1 	EQU	Iwk00B0.1   	;Bit 1 of Iwk00





;-------------------------------------------------------------------------------
;			Code section
;-------------------------------------------------------------------------------

.CODE

	ORG	0				;Code section start
	jmp	Reset				;Reset vector
						;Address 4 to 7 are reserved
	ORG	8
	jmp	Isr				;Interrupt vector

	ORG	10h
;-------------------------------------------------------------------------------
;			Program reset section
;-------------------------------------------------------------------------------
Reset:
	mov	A,#07Fh				;Initial stack pointer and
   	b0mov	STKP,A				;disable global interrupt
    	b0mov	PFLAG,#00h			;pflag = x,x,x,x,x,c,dc,z
	b0mov	RBANK,#00h			;Set initial RAM bank in bank 0
	mov  	A,#40h				;Clear watchdog timer and initial system mode
	b0mov	OSCM,A

    	call 	ClrRAM				;Clear RAM
    	call 	SysInit				;System initial
    	b0bset	FGIE				;Enable global interrupt

;-------------------------------------------------------------------------------
;			Main routine
;-------------------------------------------------------------------------------
Main:
	b0bset	FWDRST				;Clear watchdog timer

;	call	MnApp

	jmp	Main

;-------------------------------------------------------------------------------
;			Main application
;-------------------------------------------------------------------------------
MnApp:
; Put your main program here

	
	ret

;-----------------------------------
;	Jump table routine
;-----------------------------------
	ORG	0x0100				;The jump table should start from the head 
						;of boundary.
	b0mov	A,Wk00B0              
	and	A,#3
	ADD    	PCL,A
	jmp    	JmpSub0
	jmp    	JmpSub1
	jmp    	JmpSub2
;-----------------------------------


JmpSub0:
	; Subroutine 1
	jmp	JmpExit

JmpSub1:
	; Subroutine 2
	jmp	JmpExit

JmpSub2:
	; Subroutine 3
	jmp	JmpExit

JmpExit:
	ret					;Return Main

;-------------------------------------------------------------------------------
; Isr (Interrupt Service Routine)
; Arguments	: 
; Returns	: 
; Reg Change: 
;-------------------------------------------------------------------------------
/*
Processing multi-interrupt request needs to set the priority of these interrupt requests.
The IRQ flags of the 7 interrupt are controlled by the interrupt event occurring. But the
IRQ flag set doesn't mean the system to execute the interrupt vector. The IRQ flags can be
triggered by the events without interrupt enable. Just only any the event occurs and the 
IRQ will be logic "1".
There are two things need to do for multi-interrupt. One is to make a good priority for
these interrupts. Two is using IEN and IRQ flags to decide executing interrupt service 
routine or not.
*/

Isr:
;-----------------------------------
;	Save ACC and system registers
;-----------------------------------
	b0xch	A,AccBuf			;B0xch instruction do not change C,Z flag
	push					; Save 80h ~ 87h system							

;-----------------------------------
;   Check which interrupt happen
;-----------------------------------

INTP00CHK:					; Check INT0 interrupt request
	B0BTS1	FP00IEN				; Check P00IEN
	JMP	INTP01CHK			; Jump check to next interrupt
	B0BTS0	FP00IRQ				; Check P00IRQ
	JMP	INTP00				; Jump to INT0 interrupt service routine
INTP01CHK:					; Check INT1 interrupt request
	B0BTS1	FP01IEN				; Check P01IEN
	JMP	INTP02CHK			; Jump check to next interrupt
	B0BTS0	FP01IRQ				; Check P01IRQ
	JMP	INTP01				; Jump to INT1 interrupt service routine
INTP02CHK:					; Check INT2 interrupt request
	B0BTS1	FP02IEN				; Check P02IEN
	JMP	INTT0CHK			; Jump check to next interrupt
	B0BTS0	FP02IRQ				; Check P02IRQ
	JMP	INTP02				; Jump to INT2 interrupt service routine
INTT0CHK:					; Check T0 interrupt request
	B0BTS1	FT0IEN				; Check T0IEN
	JMP	INTTC0CHK			; Jump check to next interrupt
	B0BTS0	FT0IRQ				; Check T0IRQ
	JMP	INTT0				; Jump to T0 interrupt service routine
INTTC0CHK:					; Check TC0 interrupt request
	B0BTS1	FTC0IEN				; Check TC0IEN
	JMP	INTTC1CHK			; Jump check to next interrupt
	B0BTS0	FTC0IRQ				; Check TC0IRQ
	JMP	INTTC0				; Jump to TC0 interrupt service routine
INTTC1CHK:					; Check TC1 interrupt request
	B0BTS1	FTC1IEN				; Check TC1IEN
	JMP	INTSIOCHK			; Jump check to next interrupt
	B0BTS0	FTC1IRQ				; Check TC1IRQ
	JMP	INTTC1				; Jump to TC1 interrupt service routine
INTSIOCHK:					; Check SIO interrupt request
	B0BTS1	FSIOIEN				; Check SIOIEN
	JMP	INT_EXIT			; Jump to exit of IRQ
	B0BTS0	FSIOIRQ				; Check SIOIRQ
	JMP	INTSIO				; Jump to SIO interrupt service routine


;-----------------------------------
; Exit interrupt service routine
;-----------------------------------

INT_EXIT:

	pop					; Restore 80h ~ 87h system registers			
	b0xch	A,AccBuf			; B0xch instruction do not change C,Z flag

	reti					; Exit the interrupt routine



;-------------------------------------------------------------------------------
;	INT0 interrupt service routine
;-------------------------------------------------------------------------------
INTP00:
	b0bclr	FP00IRQ
	
	;Process P0.0 external interrupt here

	jmp	INT_EXIT
;-------------------------------------------------------------------------------
;	INT1 interrupt service routine
;-------------------------------------------------------------------------------
INTP01:
	b0bclr	FP01IRQ

	;Process P0.1 external interrupt here

	jmp	INT_EXIT
;-------------------------------------------------------------------------------
;	INT2 interrupt service routine
;-------------------------------------------------------------------------------
INTP02:
	b0bclr	FP02IRQ

	;Process P0.2 external interrupt here

	jmp	INT_EXIT
;-------------------------------------------------------------------------------
;	T0 interrupt service routine
;-------------------------------------------------------------------------------
INTT0:
	b0bclr	FT0IRQ		;Reset T0IRQ
	
	;Process T0 internal interrupt here
	
	jmp	INT_EXIT
;-------------------------------------------------------------------------------
;	TC0 interrupt service routine
;-------------------------------------------------------------------------------
INTTC0:
	b0bclr	FTC0IRQ

	;Process TC0 timer interrupt here

	jmp	INT_EXIT
;-------------------------------------------------------------------------------
;	TC1 interrupt service routine
;-------------------------------------------------------------------------------
INTTC1:
	b0bclr	FTC1IRQ

	;Process TC1 timer interrupt here

	jmp	INT_EXIT
;-------------------------------------------------------------------------------
;	SIO interrupt service routine
;-------------------------------------------------------------------------------
INTSIO:
	b0bclr	FSIOIRQ

	;Process SIO interrupt here

	jmp	INT_EXIT

;-------------------------------------------------------------------------------
;	SysInit
; 	Initialize I/O, Timer, Interrupt, etc.
;-------------------------------------------------------------------------------
SysInit:
	MOV	A,#01100000B
	B0MOV	TC0M,A		;Set the TC0 rate to Fcpu/4
	
	MOV	A,#30		;Set the PWM duty to 30/256
	B0MOV	TC0C,A
	B0MOV	TC0R,A
	
	B0BCLR	FTC0OUT		;Disable TC0 output function
	B0BSET	FALOAD0		;Enable TC0 auto-reload function
	B0BSET	FPWM0OUT	;Enable PWM0 output to P5.4 and disable P5.4 I/O function
	B0BSET	FTC0ENB		;Enable TC0 time
;--------------------------------------------------------------------------------
	MOV	A,#01100000B
	B0MOV	TC1M,A		;Set the TC1 rate to Fcpu/4
	
	MOV	A,#30		;Set the PWM duty to 30/256
	B0MOV	TC1C,A
	B0MOV	TC1R,A
	
	B0BCLR	FTC1OUT		;Disable TC1 output function
	B0BSET	FALOAD1		;Enable TC1 auto-reload function
	B0BSET	FPWM1OUT	;Enable PWM1 output to P5.3 and disable P5.3 I/O function
	B0BSET	FTC1ENB		;Enable TC1 time

	ret

;-------------------------------------------------------------------------------
; ClrRAM
; Use index @YZ to clear RAM  (00h~7Fh)
;-------------------------------------------------------------------------------

ClrRAM:

; RAM Bank 0
	clr	Y    				;Select bank 0 
	b0mov	Z,#0x7f				;Set @YZ address from 7fh

ClrRAM10:
	clr	@YZ				;Clear @YZ content
	decms	Z  				;z = z - 1 , skip next if z=0
	jmp	ClrRAM10
	clr 	@YZ				;Clear address 0x00

; RAM Bank 1
	mov	A,#1
	b0mov	Y,A				;Select bank 1
	b0mov	Z,#0x7f				;Set @YZ address from 17fh

ClrRAM20:
	clr	@YZ				;Clear @YZ content
	decms	Z				;z = z - 1 , skip next if z=0
	jmp 	ClrRAM20
	clr 	@YZ				;Clear address 0x100
	ret

;-------------------------------------------------------------------------------
	ENDP

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美无砖专区一中文字| 中文字幕五月欧美| 欧美在线免费视屏| 91一区二区三区在线观看| www.欧美精品一二区| 成人免费黄色在线| 成人av免费在线| 91在线精品一区二区三区| 97成人超碰视| 欧美日韩国产bt| 91精品国产综合久久久久| 8v天堂国产在线一区二区| 欧美一区二区精品| 久久综合中文字幕| 国产精品久久久久影院| 亚洲免费看黄网站| 亚洲国产精品久久艾草纯爱| 日日骚欧美日韩| 极品少妇xxxx精品少妇| 成人激情av网| 欧美在线影院一区二区| 精品伦理精品一区| 亚洲国产精品av| 亚洲综合999| 麻豆视频一区二区| 成人午夜电影久久影院| 日本黄色一区二区| 欧美一区二区私人影院日本| 久久久久久97三级| 一区二区三区欧美在线观看| 男男视频亚洲欧美| www.综合网.com| 7777精品伊人久久久大香线蕉的 | 亚洲成人激情综合网| 日本不卡高清视频| 粉嫩aⅴ一区二区三区四区五区 | 精彩视频一区二区三区| 成人免费不卡视频| 欧美三区在线视频| 国产欧美一区二区精品秋霞影院| 亚洲免费视频成人| 国产乱妇无码大片在线观看| 欧美性视频一区二区三区| 久久毛片高清国产| 五月天一区二区| 91在线丨porny丨国产| 日韩三级中文字幕| 亚洲精品免费一二三区| 国产伦精一区二区三区| 欧美日韩午夜在线| 综合亚洲深深色噜噜狠狠网站| 免费日本视频一区| 欧洲激情一区二区| 国产精品热久久久久夜色精品三区 | 欧美一区二区福利视频| 综合久久一区二区三区| 国产麻豆成人传媒免费观看| 日韩一区二区三区av| 一区二区三区美女| jlzzjlzz亚洲女人18| 精品处破学生在线二十三| 亚洲成人av在线电影| 91视频免费播放| 国产精品每日更新在线播放网址| 国产真实乱对白精彩久久| 4438亚洲最大| 天堂va蜜桃一区二区三区| 欧美自拍丝袜亚洲| 亚洲欧美日韩国产综合在线| 99在线热播精品免费| 国产日产欧产精品推荐色| 狠狠色狠狠色合久久伊人| 91精品午夜视频| 日韩av在线发布| 91精品国产综合久久久久| 男人操女人的视频在线观看欧美| 91麻豆精品91久久久久久清纯| 五月婷婷综合在线| 8x8x8国产精品| 久久福利视频一区二区| 欧美大胆人体bbbb| 国产乱子伦视频一区二区三区| 精品久久人人做人人爰| 精品一区中文字幕| ww亚洲ww在线观看国产| 国产成都精品91一区二区三| 国产欧美精品一区二区色综合朱莉| 国产v日产∨综合v精品视频| 国产精品欧美极品| 色偷偷成人一区二区三区91| 亚洲一区二区三区四区在线| 91精品国产综合久久精品| 蜜乳av一区二区| 精品久久国产老人久久综合| 狠狠色丁香九九婷婷综合五月| 久久精品在线观看| 91亚洲男人天堂| 偷拍一区二区三区| 久久欧美一区二区| 91丨国产丨九色丨pron| 夜夜嗨av一区二区三区四季av | 国产高清在线观看免费不卡| 中文字幕欧美日本乱码一线二线 | 麻豆成人91精品二区三区| 欧美精品一区男女天堂| 97久久超碰精品国产| 婷婷丁香激情综合| 国产清纯在线一区二区www| 色综合天天综合色综合av| 欧美a级理论片| 国产精品久久久久天堂| 6080午夜不卡| 99re热视频精品| 久久成人免费电影| 亚洲乱码一区二区三区在线观看| 欧美日韩综合在线| 国产一区二区在线电影| 亚洲欧美视频一区| 在线观看91av| 高清国产一区二区| 美女在线视频一区| 亚洲小说春色综合另类电影| 国产午夜三级一区二区三| 欧美伦理影视网| 99久久免费国产| 久久国产人妖系列| 亚洲一区二区视频在线| 国产日韩精品视频一区| 欧美精品日韩一本| 色菇凉天天综合网| 成人性生交大片| 国产一区中文字幕| 麻豆精品视频在线观看免费| 一区二区高清免费观看影视大全 | 国产精品久久毛片| 久久综合给合久久狠狠狠97色69| 欧美日韩精品电影| 一本到不卡免费一区二区| 成人精品小蝌蚪| 国产精品一区二区久久不卡| 青娱乐精品视频在线| 亚洲图片欧美一区| 亚洲中国最大av网站| 亚洲欧美aⅴ...| 成人免费一区二区三区在线观看 | 欧美丝袜丝nylons| 欧美无砖砖区免费| 欧美熟乱第一页| 在线播放视频一区| 欧美一区二区三区四区视频 | 国产亚洲一区二区三区四区| 欧美α欧美αv大片| 精品欧美黑人一区二区三区| 日韩欧美中文字幕公布| 日韩三级在线免费观看| 精品欧美一区二区三区精品久久 | 亚洲一区在线观看视频| 亚洲最大色网站| 午夜欧美大尺度福利影院在线看 | 中文字幕日本乱码精品影院| 欧美国产精品一区二区| 国产精品欧美经典| 亚洲精品免费电影| 日韩成人午夜电影| 久久国产精品区| 国产精品99久久久久久似苏梦涵| 国产成人av一区二区三区在线观看| 国产一区二区三区精品欧美日韩一区二区三区 | 国产麻豆视频精品| 不卡的av网站| 91福利资源站| 欧美一卡在线观看| 久久久久久久一区| 亚洲欧美综合另类在线卡通| 一二三区精品视频| 蜜桃视频第一区免费观看| 国产在线不卡一卡二卡三卡四卡| 国产成人自拍在线| 色噜噜狠狠色综合欧洲selulu| 欧美精品三级日韩久久| 久久久久久久久蜜桃| 亚洲男帅同性gay1069| 日本在线不卡视频| 国产999精品久久久久久绿帽| 91久久精品国产91性色tv | 国产一区不卡视频| 色婷婷亚洲综合| 26uuu国产电影一区二区| 亚洲精品久久嫩草网站秘色| 免费不卡在线观看| 99视频在线观看一区三区| 欧美肥胖老妇做爰| 国产精品乱码久久久久久| 日韩不卡免费视频| 99re这里只有精品首页| 日韩欧美国产一区二区三区| 亚洲男人的天堂在线观看| 韩国v欧美v日本v亚洲v| 欧洲国产伦久久久久久久| 欧美国产精品一区二区三区|