| D3 | D2 | D1 | D0 | 轉(zhuǎn)換時(shí)間 | 工作模式 |
| 0 | 0 | 0 | 0 | 3μs | A組單通道 |
| 0 | 0 | 0 | 1 | 6μs | A組2通道 |
| 0 | 0 | 1 | 0 | 9μs | A組3通道 |
| 0 | 0 | 1 | 1 | 12μs | A組4通道 |
| 0 | 1 | 0 | 0 | 3μs | B組單通道 |
| 0 | 1 | 0 | 1 | 6μs | B組2通道 |
| 0 | 1 | 1 | 0 | 9μs | B組3通道 |
| 0 | 1 | 1 | 1 | 12μs | B組4通道 |
| 1 | x | x | x | — | 低功耗(A組單通道) |
MAX125轉(zhuǎn)換模式表[3]
2.2 軟件編程
A/D數(shù)據(jù)采集的初始化程序部分:
A/D輸入口:adr.set0f730h;read
adw.set0f730h;write
.global _ADCHS
_ADCHS.set62h
mar*,ar5
larar5,#adr
lacc*;讀A/D以便清除系統(tǒng)上電引起的虛假的轉(zhuǎn)換完成信號(hào)
larar5,#adw
lacc#01h
sacl_ADCHS
sacl*;初始化MAX125的工作模式為A組2通道
splk#12499,60h
out60h,prd
out60h,tim
splk#0c00h,60h
out60h,tcr;選用F206片上定時(shí)器作為觸發(fā)源,初始化定時(shí)器,設(shè)置定時(shí)時(shí)間間隔(即A/D采樣周期)
ldp#0
splk#003fh,ifr
splk#0013h,60h
out60h,icr
splk#0007h,imr;開F206的中斷
用于讀取A/D數(shù)據(jù)的F206外部中斷1服務(wù)程序(以A組2通道、B組2通道的工作模式為例):
在C主程序中已經(jīng)定義有unsignedintadsample[160]; 此數(shù)組用于存放采樣數(shù)據(jù)
匯編中聲明有.global_adsample
_sampling:
popd*+
sarar0,*+
sarar1,*
larkar0,1
larar0,*0+,ar4;調(diào)用sampling()函數(shù)時(shí)的初始處理
ssxm
ldp#0
larar0,#40
larar2,#adr
bit_ADCHS,13
bcndchanch,TC;TC=1即D2位為1,跳轉(zhuǎn)去轉(zhuǎn)換B組2通道;否則D2位為0,轉(zhuǎn)換A組2通道
larar4,#_adsample+72
rpt#32
dmov*-
larar4,#_adsample+32
rpt#32
dmov*-
CH1A: mar*+,ar2
lacl*,ar4
sacl*,2
CH2A: mar*0+,ar2
lacl*,ar4
sacl*,2
mar*0+,ar2
lacc#05h;下次中斷轉(zhuǎn)換B組2通道
bch_switch
chanch:larar4,#_adsample+152
rpt#32
dmov*-
larar4,#_adsample+112
rpt#32
dmov*-
CH1B:mar*+,ar2
lacl*,ar4
sacl*,2
CH2B:mar*0+,ar2
lacl*,ar4
sacl*,2
mar*0+,ar2
lacc#01h;下次中斷轉(zhuǎn)換A組2通道
ch_switch:sacl_ADCHS
larar2,#adw
sacl*,ar1;函數(shù)返回前重新編程MAX125的轉(zhuǎn)換模式
sbrk2
larar0,*-
pshd*
ret;函數(shù)的結(jié)束處理
3. 結(jié)束語
MAX125應(yīng)用于FTU中,對(duì)于實(shí)現(xiàn)電力系統(tǒng)電壓、電流等信號(hào)的實(shí)時(shí)采集,進(jìn)而完成監(jiān)控和各項(xiàng)保護(hù)功能起到了重要的作用。不僅如此,MAX125還廣泛應(yīng)用于多相電機(jī)控制、功率因數(shù)監(jiān)控、電網(wǎng)同步分析、數(shù)字信號(hào)處理等領(lǐng)域。
參考文獻(xiàn):
1.李剛林凌葉文宇編著TMS320F206 DSP結(jié)構(gòu)、原理及應(yīng)用北京航空航天大學(xué)出版社2002年
2.孫涵芳INTEL 16位單片機(jī)北京航空航天大學(xué)出版社
3.MAXIM公司產(chǎn)品手冊(cè)2000年





