关于HV_SOLAR_DC_AC_v1.1示例程序问题
[复制链接]
问题一: ;=============================
ADCDRV_5ch .macro m,n,p,q,s
;=============================
MOVW DP, #_ADCDRV_5ch_RltPtrA ; Load Data Page
MOVL XAR0,@_ADCDRV_5ch_RltPtrA ; Load Rlt1 Data Page Pointer in XAR0
MOVL XAR1,@_ADCDRV_5ch_RltPtrB ; Load Rlt2 Data Page Pointer in XAR1
MOVW DP, #_AdcResult ; load Data Page to read ADC results
MOV ACC, @_AdcResult.ADCRESULT:m:<<12 ; read result
SUB ACC, #2048<<12 ; ACC = ADCRESULT - 2048
MOVL *XAR0,ACC ; store result in output pointer location
MOV ACC, @_AdcResult.ADCRESULT:n:<<12 ; read result
SUB ACC,#2048<<12 ; ACC = ADCRESULT - 2048
MOVL *XAR1,ACC MOVW DP, #_ADCDRV_5ch_RltPtrC ; Load Data Page
MOVL XAR0,@_ADCDRV_5ch_RltPtrC ; Load Rlt1 Data Page Pointer in XAR0
MOVL XAR1,@_ADCDRV_5ch_RltPtrD ; Load Rlt2 Data Page Pointer in XAR1
MOVL XAR2,@_ADCDRV_5ch_RltPtrE
MOVW DP, #_AdcResult ; load Data Page to read ADC results
MOV ACC, @_AdcResult.ADCRESULT:p:<<12 ; read result
MOVL *XAR0,ACC ; store result in output pointer location
MOV ACC, @_AdcResult.ADCRESULT:q:<<12 ; read result
MOVL *XAR1,ACC ; store result in output pointer location
MOV ACC, @_AdcResult.ADCRESULT:s:<<12 ; read result
MOVL *XAR2,ACC ; store result in output pointer location
.endm
如上面的宏库内容中MOV ACC, @_AdcResult.ADCRESULT:m:<<12 ; read result,为什么AD转换的结果要左移12位? 问题二: 上面的IQ20(376.9911)为什么代表60HZ?是如何转换的。麻烦请解答一下。谢谢!
|