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

📄 foc_1.asm.bak

📁 foc 通信程序源码
💻 BAK
📖 第 1 页 / 共 4 页
字号:
		ldp #04h
		sacl da2 				;if yes, get it and store it in da2

navail23
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail23,ntc 		;if not repeat the cycle (polling)
		
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h
		sacl da3 				;if yes, get it and store it in da3

navail24
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail24,ntc 		;if not repeat the cycle (polling)
		
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h
		sacl da4 				;if yes, get it and store it in da4
		
		b menu 					;return to the main polling cycle
*** END Option 2): DAC update

nottwo
		lacc option
		sub #03h 				;is it option 3 ?
		bcnd notthree,neq 		;if not branch to notthree  
		
		
*****************************
* Option 3): flag run
*****************************
navail31
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any characteravailable (8 LSB)?
		bcnd navail31,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #05h 			;control variable page
		sacl running 			;if yes, get it and store it in serialtmp

		b menu 					;return to the main polling cycle
*** END Option 3): iSdref 

notthree
		lacc option
		sub #04h 				;is it option 4 ?
		bcnd notfour,neq 		;if not branch to notthree
		
		
*****************************************************
* Option 4): current regulator parameters setting
*****************************************************
navail41
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail41,ntc 		;if not repeat the cycle (polling)		
		
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail42
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail42,ntc 		;if not repeat the cycle (polling)
		
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kpi 				;store it in Kpi
		
navail43
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail43,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail44
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail44,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			;control variable page
		add serialtmp 			;add ACC with lower byte 
		sacl Ki 				;store it in Ki

navail45
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail45,ntc 		;if not repeat the cycle (polling)
		
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail46
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail46,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kcor 				;store it in Kcor
		
		b menu 					;return to the main polling cycle
*** END Option 4): current regulator parameters setting

notfour
		lacc option
		sub #05h 				;is it option 5 ?
		bcnd notfive,neq 		;if not branch to notfive


*****************************************************
* Option 5): speed regulator parameters setting
*****************************************************
navail51
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail52
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kpin 				;store it in Kpin

navail53
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail53,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail54
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail54,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kin 				;store it in Kin

navail55
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any character available (8 LSB)?
		bcnd navail55,ntc 		;if not repeat the cycle (polling)
		
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail56
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail56,ntc 		;if not repeat the cycle (polling)

		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kcorn 				;store it in Kcorn

		b menu 					;return to the main polling cycle
*** END Option 5): speed regulator parameters setting 

notfive    
     	lacc option
		sub #06h 				;is it option 5 ?
		bcnd notsix,neq 		;if not branch to notfive

********************************************************************
* option 6)  parameters for the current model:Kr,Kt
********************************************************************
navail61
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail62
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kr 				;store it in Kr

navail63
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			    ;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail64
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kt 				;store it in Kt

notsix 
		lacc option
		sub #07h 				;is it option 7 ?
		bcnd notseven,neq 		;if not branch to notfive
		
********************************************************************
* option 7)  DC voltage and current scale parameters
********************************************************************
navail71
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail72
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl Kcurrent 				;store it in Kcurrent

navail73
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			    ;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail74
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl VDC 				;store it in VDC

navail75
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			    ;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail76
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl VDCinvT 			;store it in VDCinvT
		B menu                                      
		
notseven 
		lacc option
		sub #08h 				;is it option 8 ?
		bcnd noteight,neq 		;if not branch to noteight

*********************************************************************
* option 8) flux weakening polynomal parameters
*********************************************************************
navail81
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail82
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page
		add serialtmp 			;add ACC with lower byte
		sacl p0 				;store it in p0

navail83
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;is there any available (8 LSB)?
		bcnd navail51,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF
		and #0FFh 				;take the 8 LSB
		ldp #04h 			    ;control variable page
		sacl serialtmp 			;if yes, get it and store it in serialtmp

navail84
		ldp #DP_PF1
		bit SCIRXST,BIT6 		;8 MSB available ?
		bcnd navail52,ntc 		;if not repeat the cycle (polling)
		lacc SCIRXBUF,8 		;load ACC the upper byte
		ldp #04h 			    ;control variable page

⌨️ 快捷键说明

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