MSP430AD轉(zhuǎn)換
對SHI加一個(gè)上升沿的信號則初始化AD轉(zhuǎn)換,
本文引用地址:http://m.butianyuan.cn/article/201611/316557.htmAn analog-to-digital conversion is initiatedwith a rising edge of the sample
input signal SHI. The source for SHI is selected with the SHSx bits and
includes the following:
The ADC12SC bit
The Timer_A Output Unit 1
The Timer_B Output Unit 0
The Timer_B Output Unit 1
The polarity of the SHI signal source can be inverted with the ISSH bit. The
SAMPCON signal controls the sample period and start of conversion. When
SAMPCON is high, sampling is active. The high-to-low SAMPCON transition
starts the analog-to-digital conversion, which requires13 ADC12CLKcycles.
Two different sample-timing methods are defined by control bit SHP, extended
sample mode and pulse mode
其中擴(kuò)展采樣模式(SHP=0):即SHI信號直接決定采樣時(shí)間,參看DATASHEET和時(shí)序圖
脈沖采樣模式時(shí),SHI只負(fù)責(zé)輸入一個(gè)上升沿信號來觸發(fā)采樣,而采樣時(shí)間由ADC12CLK及SH0_X或SHT1_X決定,
轉(zhuǎn)換存儲(chǔ)器:MSP430有16個(gè)轉(zhuǎn)換存儲(chǔ)器,對應(yīng)16個(gè)8位的存儲(chǔ)控制寄存器,在儲(chǔ)存控制寄存器ADC12MCTLX中涉及到EOS, INCH,SREF。
其中:INCH 主要用于選擇AD轉(zhuǎn)換通道,SREF主要用于選擇AD轉(zhuǎn)換時(shí)的基準(zhǔn)參考電壓,EOS用于,順序轉(zhuǎn)換或重復(fù)順序轉(zhuǎn)換時(shí)定位最后一個(gè)通道。
ADC12共有四種轉(zhuǎn)換模式:單通道單次轉(zhuǎn)換
順序轉(zhuǎn)換
重復(fù)單通道轉(zhuǎn)換
重復(fù)順序轉(zhuǎn)換
由四種轉(zhuǎn)換模式原理圖可知,在ADC12CTL1中由CSTARTADDX 決定采樣后結(jié)果暫存于那個(gè)寄存器,若是順序模式時(shí),會(huì)在原有設(shè)定基礎(chǔ)上,以自加一的方式把結(jié)果存入ADC12MEMX中,
注意點(diǎn):EOS位于最后一個(gè)通道的ADC12MCTLX中,并且,中斷允許是最后一個(gè)通道對應(yīng)的ADC12MEMX對應(yīng)的中斷允許置位。其中MSC的作用是:在順序轉(zhuǎn)換或重復(fù)轉(zhuǎn)換中,若MSC置1則只需最初有一個(gè)觸發(fā)信號,隨后都會(huì)在前一次轉(zhuǎn)換完成后,自動(dòng)進(jìn)入下一次轉(zhuǎn)換。否則的話,每次轉(zhuǎn)換完成都還需另個(gè)的觸發(fā)信號。-----------DATASHEET.
綜上所述,MSP430ADC12的關(guān)鍵在于,ADC12CLK的選取及分頻,通道的選擇,觸發(fā)方式的選取,緩沖存儲(chǔ)器的選取,采樣定時(shí)的方式(脈沖采樣、擴(kuò)展采樣),轉(zhuǎn)換模式選取,ADC12參考基準(zhǔn)的選取。
評論