国产精品久久久aaaa,日日干夜夜操天天插,亚洲乱熟女香蕉一区二区三区少妇,99精品国产高清一区二区三区,国产成人精品一区二区色戒,久久久国产精品成人免费,亚洲精品毛片久久久久,99久久婷婷国产综合精品电影,国产一区二区三区任你鲁

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

如何制作一個(gè)簡(jiǎn)易的Sigma Delta ADC?

電子森林 ? 來(lái)源:電子森林 ? 作者:電子森林 ? 2021-04-01 10:27 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

本文為備戰(zhàn)電賽的案例之一,涉及到的知識(shí)技能:

FPGA的使用

ADC的原理及構(gòu)成

PWM的產(chǎn)生

比較器的應(yīng)用

數(shù)字濾波器的使用

使用的平臺(tái):

多數(shù)FPGA芯片上沒有ADC的功能,而一些應(yīng)用則需要用到ADC對(duì)一些模擬信號(hào),比如直流電壓等進(jìn)行量化,有沒有特別簡(jiǎn)單、低成本的實(shí)現(xiàn)方法呢?

在要求轉(zhuǎn)換速率不高的情況下,完全可以借助一顆高速比較器(成本只有幾毛錢)來(lái)實(shí)現(xiàn)對(duì)模擬信號(hào)的量化,Lattice的官網(wǎng)上一篇文章就介紹了如何制作一個(gè)簡(jiǎn)易的Sigma Delta ADC,如果FPGA能夠提供LVDS的接口,連外部的高速比較器都可以省掉。由于我們的小腳丫FPGA核心模塊在設(shè)計(jì)的時(shí)候沒有考慮到LVDS的應(yīng)用場(chǎng)景,所以還是需要搭配一個(gè)高速的比較器來(lái)實(shí)現(xiàn)Lattice官網(wǎng)上推薦的簡(jiǎn)易Sigma Delta ADC的功能。

讓小腳丫FPGA通過鎖相環(huán)PLL運(yùn)行于120MHz的主時(shí)鐘(還可以更高,提速到240MHz、360MHz都應(yīng)該沒有問題),測(cè)試1KHz以內(nèi)的模擬信號(hào)是沒有問題的。

Lattice的官網(wǎng)上就可以下載到簡(jiǎn)易Sigma Delta ADC的Verilog源代碼,可以非常方便地用在其它品牌、其它系列的FPGA上。

下面的截圖就是采用120MHz的主時(shí)鐘實(shí)現(xiàn)的對(duì)1KHz模擬信號(hào)的采樣,并通過DDS/DAC輸出,口袋儀器M2000采集并顯示的模擬信號(hào)波形。

b31525ca-9245-11eb-8b86-12bb97331649.png

M2000口袋儀器顯示的1KHz的波形

工作原理

詳細(xì)的工作原理介紹可以參考項(xiàng)目https://www.eetree.cn/project/detail/255 及項(xiàng)目頁(yè)面中的參考資料,在這里以幾幅圖片來(lái)示例一下。

b32101f6-9245-11eb-8b86-12bb97331649.png

簡(jiǎn)易Sigma Delta ADC的工作原理

b3503caa-9245-11eb-8b86-12bb97331649.png

直接連接 - 被測(cè)模擬信號(hào)的幅度范圍為0-3.3V

b35b174c-9245-11eb-8b86-12bb97331649.png

通過電阻分壓網(wǎng)絡(luò)輸入,并在比較器+端提供參考電壓,則被采集模擬信號(hào)的電壓變化范圍可以擴(kuò)展

b36482a0-9245-11eb-8b86-12bb97331649.png

簡(jiǎn)易Sigma Delta ADC的性能與邏輯電路的工作頻率

b36d37f6-9245-11eb-8b86-12bb97331649.png

在不同的FPGA平臺(tái)上消耗的邏輯資源

以下就是我們的電賽綜合訓(xùn)練板上簡(jiǎn)易Sigma Delta ADC部分的電路連接

b379f7e8-9245-11eb-8b86-12bb97331649.png

核心代碼:

頂層調(diào)用代碼:

wire [7:0] sd_adc_out; // sigma delta adc data output

wire sample_rdy; // flag for adc conversion

ADC_top my_adc(.clk_in(clk_hs),.rstn(1‘b1),.digital_out(sd_adc_out), .analog_cmp(comp_in),.analog_out(ad_pwm),.sample_rdy(sample_rdy));

assign dac_data = sd_adc_out;assign dac_clk = clk_hs; //120MHz generated by PLL

Sigma Delta ADC頂層程序

//*********************************************************************//// ADC Top Level Module////*********************************************************************

module ADC_top ( clk_in, rstn, digital_out, analog_cmp, analog_out, sample_rdy);

parameter ADC_WIDTH = 8, // ADC Convertor Bit PrecisionACCUM_BITS = 10, // 2^ACCUM_BITS is decimation rate of accumulatorLPF_DEPTH_BITS = 3, // 2^LPF_DEPTH_BITS is decimation rate of averagerINPUT_TOPOLOGY = 1; // 0: DIRECT: Analog input directly connected to + input of comparitor // 1: NETWORK:Analog input connected through R divider to - input of comp.

//input portsinput clk_in; // 62.5Mhz on Control Demo boardinput rstn; input analog_cmp; // from LVDS buffer or external comparitor

//output portsoutput analog_out; // feedback to RC networkoutput sample_rdy;output [7:0] digital_out; // connected to LED field on control demo bd.

//**********************************************************************//// Internal Wire & Reg Signals////**********************************************************************wire clk;wire analog_out_i;wire sample_rdy_i;wire [ADC_WIDTH-1:0] digital_out_i;wire [ADC_WIDTH-1:0] digital_out_abs;

assign clk = clk_in;

//***********************************************************************//// SSD ADC using onboard LVDS buffer or external comparitor////***********************************************************************sigmadelta_adc #( .ADC_WIDTH(ADC_WIDTH), .ACCUM_BITS(ACCUM_BITS), .LPF_DEPTH_BITS(LPF_DEPTH_BITS) )SSD_ADC( .clk(clk), .rstn(rstn), .analog_cmp(analog_cmp), .digital_out(digital_out_i), .analog_out(analog_out_i), .sample_rdy(sample_rdy_i) );

assign digital_out_abs = INPUT_TOPOLOGY ? ~digital_out_i : digital_out_i;

//***********************************************************************//// output assignments////***********************************************************************

assign digital_out = ~digital_out_abs; // invert bits for LED display assign analog_out = analog_out_i;assign sample_rdy = sample_rdy_i;

endmodule

Sigma Delta ADC主程序

//*********************************************************************//// SSD Top Level Module////*********************************************************************

module sigmadelta_adc ( clk, rstn, digital_out, analog_cmp, analog_out, sample_rdy);

parameter ADC_WIDTH = 8, // ADC Convertor Bit PrecisionACCUM_BITS = 10, // 2^ACCUM_BITS is decimation rate of accumulatorLPF_DEPTH_BITS = 3; // 2^LPF_DEPTH_BITS is decimation rate of averager

//input portsinput clk; // sample rate clockinput rstn; // async reset, asserted lowinput analog_cmp ; // input from LVDS buffer (comparitor)

//output portsoutput analog_out; // feedback to comparitor input RC circuitoutput sample_rdy; // digital_out is readyoutput [ADC_WIDTH-1:0] digital_out; // digital output word of ADC

//**********************************************************************//// Internal Wire & Reg Signals////**********************************************************************reg delta; // captured comparitor outputreg [ACCUM_BITS-1:0] sigma; // running accumulator valuereg [ADC_WIDTH-1:0] accum; // latched accumulator valuereg [ACCUM_BITS-1:0] counter; // decimation counter for accumulatorreg rollover; // decimation counter terminal countreg accum_rdy; // latched accumulator value ’ready‘

//***********************************************************************//// SSD ’Analog‘ Input - PWM//// External Comparator Generates High/Low Value////***********************************************************************

always @ (posedge clk)begin delta 《= analog_cmp; // capture comparitor outputend

assign analog_out = delta; // feedback to comparitor LPF

//***********************************************************************//// Accumulator Stage//// Adds PWM positive pulses over accumulator period////***********************************************************************

always @ (posedge clk or negedge rstn)begin if( ~rstn ) begin sigma 《= 0; accum 《= 0; accum_rdy 《= 0; end else begin if (rollover) begin // latch top ADC_WIDTH bits of sigma accumulator (drop LSBs) accum 《= sigma[ACCUM_BITS-1:ACCUM_BITS-ADC_WIDTH]; sigma 《= delta; // reset accumulator, prime with current delta value end else begin if (&sigma != 1’b1) // if not saturated sigma 《= sigma + delta; // accumulate end accum_rdy 《= rollover; // latch ‘rdy’ (to align with accum) endend

//***********************************************************************//// Box filter Average//// Acts as simple decimating Low-Pass Filter////***********************************************************************

box_ave #( .ADC_WIDTH(ADC_WIDTH), .LPF_DEPTH_BITS(LPF_DEPTH_BITS))box_ave ( .clk(clk), .rstn(rstn), .sample(accum_rdy), .raw_data_in(accum), .ave_data_out(digital_out), .data_out_valid(sample_rdy));

//************************************************************************//// Sample Control - Accumulator Timing// //************************************************************************

always @(posedge clk or negedge rstn)begin if( ~rstn ) begin counter 《= 0; rollover 《= 0; end else begin counter 《= counter + 1; // running count rollover 《= &counter; // assert ‘rollover’ when counter is all 1‘s endendendmodule

數(shù)字低通濾波器模塊,做平滑濾波

//*********************************************************************//// ’Box‘ Average //// Standard Mean Average Calculation// Can be modeled as FIR Low-Pass Filter where // all coefficients are equal to ’1‘。////*********************************************************************

module box_ave ( clk, rstn, sample, raw_data_in, ave_data_out, data_out_valid);

parameter ADC_WIDTH = 8, // ADC Convertor Bit PrecisionLPF_DEPTH_BITS = 4; // 2^LPF_DEPTH_BITS is decimation rate of averager

//input portsinput clk; // sample rate clockinput rstn; // async reset, asserted lowinput sample; // raw_data_in is good on rising edge, input [ADC_WIDTH-1:0] raw_data_in; // raw_data input

//output portsoutput [ADC_WIDTH-1:0] ave_data_out; // ave data outputoutput data_out_valid; // ave_data_out is valid, single pulse

reg [ADC_WIDTH-1:0] ave_data_out; //**********************************************************************//// Internal Wire & Reg Signals////**********************************************************************reg [ADC_WIDTH+LPF_DEPTH_BITS-1:0] accum; // accumulatorreg [LPF_DEPTH_BITS-1:0] count; // decimation countreg [ADC_WIDTH-1:0] raw_data_d1; // pipeline register

reg sample_d1, sample_d2; // pipeline registersreg result_valid; // accumulator result ’valid‘wire accumulate; // sample rising edge detectedwire latch_result; // latch accumulator result

//***********************************************************************//// Rising Edge Detection and data alignment pipelines////***********************************************************************always @(posedge clk or negedge rstn)begin if( ~rstn ) begin sample_d1 《= 0; sample_d2 《= 0; raw_data_d1 《= 0; result_valid 《= 0; end else begin sample_d1 《= sample; // capture ’sample‘ input sample_d2 《= sample_d1; // delay for edge detection raw_data_d1 《= raw_data_in; // pipeline result_valid 《= latch_result; // pipeline for alignment with result endend

assign accumulate = sample_d1 && !sample_d2; // ’sample‘ rising_edge detectassign latch_result = accumulate && (count == 0); // latch accum. per decimation count

//***********************************************************************//// Accumulator Depth counter////***********************************************************************always @(posedge clk or negedge rstn)begin if( ~rstn ) begin count 《= 0; end else begin if (accumulate) count 《= count + 1; // incr. count per each sample endend

//***********************************************************************//// Accumulator////***********************************************************************always @(posedge clk or negedge rstn)begin if( ~rstn ) begin accum 《= 0; end else begin if (accumulate) if(count == 0) // reset accumulator accum 《= raw_data_d1; // prime with first value else accum 《= accum + raw_data_d1; // accumulate end end //***********************************************************************//// Latch Result//// ave = (summation of ’n‘ samples)/’n‘ is right shift when ’n‘ is power of two////***********************************************************************always @(posedge clk or negedge rstn)begin if( ~rstn ) begin ave_data_out 《= 0; end else if (latch_result) begin // at end of decimation period.。. ave_data_out 《= accum 》》 LPF_DEPTH_BITS; // 。.. save accumulator/n result endend

assign data_out_valid = result_valid; // output assignment

endmodule

原文標(biāo)題:如何在FPGA上用一個(gè)比較器實(shí)現(xiàn)ADC的功能?

文章出處:【微信公眾號(hào):FPGA入門到精通】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。

責(zé)任編輯:haq

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
  • FPGA
    +關(guān)注

    關(guān)注

    1660

    文章

    22412

    瀏覽量

    636284
  • adc
    adc
    +關(guān)注

    關(guān)注

    100

    文章

    7511

    瀏覽量

    555949

原文標(biāo)題:如何在FPGA上用一個(gè)比較器實(shí)現(xiàn)ADC的功能?

文章出處:【微信號(hào):xiaojiaoyafpga,微信公眾號(hào):電子森林】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。

收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評(píng)論

    相關(guān)推薦
    熱點(diǎn)推薦

    高精度隔離型Sigma-Delta調(diào)制器ISOSD61:特性、應(yīng)用與設(shè)計(jì)指南

    。STMicroelectronics推出的ISOSD61高精度隔離型Sigma-Delta調(diào)制器,憑借其卓越的性能和廣泛的應(yīng)用適應(yīng)性,成為了工程師們的理想選擇。今天,我們就來(lái)深入了解下這款調(diào)制器。 文件下載
    的頭像 發(fā)表于 02-11 14:35 ?175次閱讀

    深入剖析LMX2470:高性能Delta - Sigma分?jǐn)?shù)N PLL的全方位解讀

    、高性能的Delta - Sigma分?jǐn)?shù)N PLL,同時(shí)還配備了個(gè)輔助整數(shù)N PLL。它采用TI先進(jìn)的BiCMOS工藝制造,具有低帶內(nèi)相位噪聲和低分頻雜
    的頭像 發(fā)表于 02-10 13:50 ?187次閱讀

    LMX2485x 3 - GHz Delta - Sigma低功耗雙PLLatinum?頻率合成器深度解析

    )的LMX2485x 3 - GHz Delta - Sigma低功耗雙PLLatinum?頻率合成器,它在眾多應(yīng)用場(chǎng)景中展現(xiàn)出了卓越的性能。 文件下載: lmx2485.pdf 、產(chǎn)品概述 LMX2485x
    的頭像 發(fā)表于 02-10 11:15 ?157次閱讀

    深度解析ADS1282 - HT:高溫高精度Delta - Sigma ADC的卓越之選

    深度解析ADS1282 - HT:高溫高精度Delta - Sigma ADC的卓越之選 在電子設(shè)計(jì)領(lǐng)域,對(duì)于高精度和高溫適應(yīng)性兼?zhèn)涞哪?shù)轉(zhuǎn)換器(ADC)的需求日益增長(zhǎng)。ADS1282
    的頭像 發(fā)表于 02-05 14:25 ?229次閱讀

    AMC1203:高精度隔離Delta - Sigma調(diào)制器的深度解析

    AMC1203:高精度隔離Delta - Sigma調(diào)制器的深度解析 在電子設(shè)計(jì)領(lǐng)域,高精度的電流傳感和信號(hào)處理直是工程師們追求的目標(biāo)。AMC1203作為款精密的、具有基本隔離功能
    的頭像 發(fā)表于 01-25 09:35 ?279次閱讀

    AMC1304x:高精度、增強(qiáng)型隔離Delta - Sigma調(diào)制器的設(shè)計(jì)與應(yīng)用解析

    )的AMC1304x系列高精度、增強(qiáng)型隔離Delta - Sigma調(diào)制器,以其卓越的性能和豐富的特性,為我們提供了個(gè)強(qiáng)大的解決方案。今天,我們就來(lái)深入探討
    的頭像 發(fā)表于 01-23 11:05 ?192次閱讀

    AMC1303x:小尺寸、高精度、強(qiáng)化隔離的 Delta - Sigma 調(diào)制器深度解析

    正是這樣款值得關(guān)注的產(chǎn)品,它為多種工業(yè)應(yīng)用提供了出色的解決方案。今天,我們就來(lái)深入探討下 AMC1303x 小尺寸、高精度、強(qiáng)化隔離的 Delta - Sigma 調(diào)制器。 文件下
    的頭像 發(fā)表于 01-22 15:40 ?145次閱讀

    探索ACPL - C799U:±50 mV光隔離Sigma - Delta調(diào)制器的卓越性能與應(yīng)用

    ACPL-C799U ±50mV Σ-Δ調(diào)制器.pdf 、ACPL - C799U概述 ACPL - C799U是款1位、二階Sigma - Delta(Σ–Δ)調(diào)制器,它利用光
    的頭像 發(fā)表于 12-30 14:25 ?305次閱讀

    ADC高端醫(yī)療芯片,Sigma-Delta模擬數(shù)字轉(zhuǎn)換器作用

    在現(xiàn)代高端醫(yī)療設(shè)備中,精確的信號(hào)采集是可靠診斷的基石。身體產(chǎn)生的許多關(guān)鍵信號(hào),如心電、腦電、血液成分變化等,都是微弱的模擬信號(hào)。Sigma-Delta模擬數(shù)字轉(zhuǎn)換器就是將這些信號(hào)高保真地轉(zhuǎn)換為數(shù)字世界可讀、可分析的數(shù)據(jù)的應(yīng)用工具。
    的頭像 發(fā)表于 12-16 15:07 ?354次閱讀

    深入解析ADS1202:高性能Delta-Sigma調(diào)制器的全面指南

    ? 在電子工程領(lǐng)域,模數(shù)轉(zhuǎn)換器(ADC)是連接模擬世界和數(shù)字世界的關(guān)鍵橋梁。而德州儀器(TI)的ADS1202作為款高性能的Delta-Sigma調(diào)制器,在眾多應(yīng)用中展現(xiàn)出了卓越的性能。今天,我們
    的頭像 發(fā)表于 12-05 11:19 ?703次閱讀
    深入解析ADS1202:高性能<b class='flag-5'>Delta-Sigma</b>調(diào)制器的全面指南

    低功耗Sigma-Delta ADC模數(shù)轉(zhuǎn)換器

    與傳統(tǒng)的逐次逼近型(SAR)ADC不同,Sigma-Delta ADC采用了過采樣和噪聲整形技術(shù)。其核心原理可通俗理解為:它并不追求單次采樣的絕對(duì)準(zhǔn)確,而是以遠(yuǎn)高于信號(hào)頻率的速度進(jìn)行高速采樣,隨后
    的頭像 發(fā)表于 12-03 14:23 ?344次閱讀

    深入剖析ADS1203:高性能Delta-Sigma調(diào)制器的設(shè)計(jì)與應(yīng)用

    ? 在電子設(shè)計(jì)領(lǐng)域,模數(shù)轉(zhuǎn)換器(ADC)是連接模擬世界和數(shù)字世界的關(guān)鍵橋梁。而Delta-Sigma調(diào)制器作為種特殊的ADC架構(gòu),以其高分辨率、低噪聲等優(yōu)勢(shì),在眾多應(yīng)用場(chǎng)景中得到了廣
    的頭像 發(fā)表于 12-03 11:21 ?595次閱讀
    深入剖析ADS1203:高性能<b class='flag-5'>Delta-Sigma</b>調(diào)制器的設(shè)計(jì)與應(yīng)用

    深度剖析ADS1205:高性能Delta-Sigma調(diào)制器的卓越之選

    ? 在電子設(shè)計(jì)領(lǐng)域,模數(shù)轉(zhuǎn)換器(ADC)的性能對(duì)系統(tǒng)的整體表現(xiàn)起著關(guān)鍵作用。TI的ADS1205作為款高性能的雙通道Delta-Sigma調(diào)制器,憑借其出色的特性和廣泛的應(yīng)用場(chǎng)景,成為了眾多工程師
    的頭像 發(fā)表于 12-01 14:26 ?530次閱讀
    深度剖析ADS1205:高性能<b class='flag-5'>Delta-Sigma</b>調(diào)制器的卓越之選

    分享Sigma Delta型模數(shù)轉(zhuǎn)換器(高精度ADC工作原理)

    Sigma Delta型模數(shù)轉(zhuǎn)換器又稱Σ-Δ型模數(shù)轉(zhuǎn)換器,模數(shù)轉(zhuǎn)換器(ADC)作為連接物理世界與數(shù)字系統(tǒng)的關(guān)鍵部件,廣泛應(yīng)用于工業(yè)控制、汽車電子和物聯(lián)網(wǎng)設(shè)備中。其中,Σ-Δ型模數(shù)轉(zhuǎn)換器憑借其高分辨率和優(yōu)良的抗噪性能,成為高精度測(cè)
    的頭像 發(fā)表于 11-10 17:25 ?1297次閱讀

    如何判斷ADC芯片的類型?

    1:如何判斷ADC芯片的類型?SAR ADC,流水線ADC,Sigma-Delta(ΣΔ)ADC,不同類型的
    發(fā)表于 04-15 06:19