1 / 17

10-Bit A/D Converter

10-Bit A/D Converter. ADC 轉換 / 取樣動作. ADC_FORMAT_INTG. ADCON1bits.FORM 11 = 有號小數 10 = 無號小數 01 = 有號整數 00 = 整數. ADC_CLK_AUTO. ADCON1bits.SSRC 111 = 自動轉換 . . . 000 = 手動轉換 ( 清除 SAMP 後開始轉換 ). 兩種取樣方式. ADC_SAMPLE_SIMULTANEOUS. ADCON1bits.SIMSAM 1 = 所有通道同時取樣 0 = 各個通道個別取樣.

adsila
Download Presentation

10-Bit A/D Converter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 10-Bit A/D Converter

  2. ADC 轉換/取樣動作

  3. ADC_FORMAT_INTG • ADCON1bits.FORM • 11 = 有號小數 • 10 = 無號小數 • 01 = 有號整數 • 00 = 整數

  4. ADC_CLK_AUTO • ADCON1bits.SSRC • 111 = 自動轉換 • . • . • . • 000 = 手動轉換 (清除SAMP後開始轉換)

  5. 兩種取樣方式

  6. ADC_SAMPLE_SIMULTANEOUS • ADCON1bits.SIMSAM • 1 = 所有通道同時取樣 • 0 = 各個通道個別取樣

  7. ADC_AUTO_SAMPLING_OFF • ADCON1bits.ASAM • 1 = 轉換完後立即自動取樣 • 0 = 手動取樣,SAMP設為1開始取樣

  8. 10-Bit ADC BLOCK DIAGRAM

  9. 輸入多工器 • AD轉換器有兩組多工器(A與B)可選擇

  10. ADC_ALT_INPUT_OFF • ADCON2bits.ALTS • 1 = 交互使用A, B 多工器 • 0 = 只用A多工器

  11. ADC_CONVERT_CH_0A • ADCON2bits.CHPS • 1x = 轉換CH0, CHA, CHB and CHC • 01 = 轉換CH0 and CHA • 00 = 轉換CH0

  12. ADC_SAMPLES_PER_INT_1 • ADCON2bits.SMPI • 16 = 每完成16次取樣的轉換,產生1中斷 • 15 = 每完成15次取樣的轉換,產生1中斷 • . • . • . • 1 = 每完成1次取樣的轉換,產生1中斷 • 範例雖然是雙通道,但為同時取樣,所以設定為1

  13. Channel • ADC_CH0_POS_SAMPLEA_AN6 • CH0正端經A多工器接到AN6 • ADC_CH0_NEG_SAMPLEA_NVREF • CH0負端經A多工器接到VREF- (=Vss) • ADC_CHX_POS_SAMPLEA_AN0AN1AN2 • 正端經多工器A,CHA接AN0,CHB接AN1… • ADC_CHX_NEG_SAMPLEA_NVREF • CHA, CHB與CHC負端通通接到VREF-

  14. 10-Bit ADC BLOCK DIAGRAM

  15. 輸入多工器 • AD轉換器有兩組多工器(A與B)可選擇 • Output = [(VA+ - VA-)- VREF-] / (VREF+ - VREF-) * 1024 - 1

  16. BusyADC10() • ADCON1bits.DONE • 1 = 轉換完成 • 0 = 開始轉換時清除為0,也可手動清除

  17. 手動取樣自動轉換流程 同時取樣 CH0轉換 CHA轉換 同時取樣 SAMP DONE 手動設定SAMP=1 開始取樣 自動轉換 自動清除SAMP&DONE 轉換完成 自動設定DONE

More Related