⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 en_drive.asm

📁 无刷直流电机的无传感器控制TI程序
💻 ASM
字号:
********************************************************************
** File Name	: en_drive.asm						**
** Mudule names	: en_drive, dis_drive					**
** Initialization routine: drive_init					**
** Originator	: DSP Digital Control Systems Group			**
**			  Texas Instruments					**
** Description	: This program configures the I/O pins and 	**
**			  enables and disables the drive			**
** Target		: 'X24x/'X24xx, DMC1500/1000				**
**			  ('240 portion to be completed in the future)	**
********************************************************************

;=====================================================================================
; History:
;-------------------------------------------------------------------------------------
; 9-15-2000	Release	Rev 1.0	


;*****************************************************
; Define Peripherals
;*****************************************************
		.include	"x24x_app.h"

;*****************************************************
; Global References and Definitions
;*****************************************************
		.def	en_drive		;
		.def	dis_drive		;
		.def	drive_init		;

		.text
;******************************************************
; Start of main body of code
;******************************************************
drive_init
		.if x240
		; IOPB3: strobe_; IOPB6: enable_
		;x240 code
		.endif
		.if x243|x2407
		; IOPB4: strobe_; IOPB6: enable_
		ldp	#OCRA>>7		;
		lacc	OCRA			;
		and	#0afffH		; config IOPB4&6 as IO
		sacl	OCRA			;
		lacc	PBDATDIR		;
		or	#05050h 		; config IOPB4 & IOPB6 as Outputs
		sacl	PBDATDIR		; and output "1" to disable drive
		.endif
		ret

en_drive
		.if x240
		;x240 code
		.endif
		.if x243|x2407
		ldp	#PBDATDIR>>7
		lacc	PBDATDIR		; Get Port B
		and	#0ffefh 		; IOPB4 low
		sacl	PBDATDIR		;
		or	#00010h 		; IOPB4 high
		sacl	PBDATDIR		;
		and	#0ffbfh 		; IOPB6 low
		sacl	PBDATDIR		;
		.endif
		ret

dis_drive
		.if x240
		;x240 code
		.endif
		.if x243|x2407
		ldp	#PBDATDIR>>7	;
		lacc	PBDATDIR		; Get Port B
		or	#05050h 		; IOPB4 & IOPB6 Output "1"
		sacl	PBDATDIR		;
		.endif
		ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -