<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A simple frequency response analyser</title><link>/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><description>ORIGINAL POST 10/03/202UPDATED 11/03/2020 : Filter response plot added.UPDATED 17/03/2020: Board design notes added. This idea has been at the back of my mind for while, but got pushed to the top of the stack by a post from amiranghi...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Sun, 16 Aug 2020 08:32:09 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>michaelkellett</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;If you want performance then forget the Hal and mbed libraries and most of all forget the Arduino IDE.&lt;/p&gt;&lt;p&gt;The HAL stuff is OK for working out how to drive the hardware, but usually too slow and cumbersome for actual use.&lt;/p&gt;&lt;p&gt;Much as I&amp;#39;d like to help you I can&amp;#39;t give detailed tutorials about using DMA.&lt;/p&gt;&lt;p&gt;This is how I set up the ADC and DMA, it will make no sense unless you have the chip reference manual handy.&lt;/p&gt;&lt;p&gt;It would help me to help you if you explained the end goal of your project.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%2F%2F------------------------------------------------------------------------------------%0A%2F%2F+h7synth_adc.c%0A%2F%2F------------------------------------------------------------------------------------%0A%2F%2F+Copyright+2020+MK+ELECTRONICS+LTD%0A%2F%2F%0A%2F%2F+AUTH%3A+Michael+Kellett%0A%2F%2F+DATE+03%2F03%2F2020%0A%2F%2F%0A%2F%2F+H7+Synth%0A%2F%2F%0A%2F%2F+Target++STM32H743Zi+on+MKE+H7SYNTH+board%0A%2F%2F%0A%2F%2F+Tool+chain++KEIL%0A%2F%2F%0A%0A%23include+%22h7synth_project.h%22%0A%23include+%22h7synth_fast.h%22%0A%23include+%22h7synth_adc.h%22%0A%23include+%22h7synth_dds.h%22%0A%23include+%22h7synth_sigproc.h%22%0A%0A%23include+%22stm32h7xx_hal.h%22%0A%23include+%3Cstm32h7xx_hal_dac.h%3E%0A%23include+%3Cstm32h7xx_hal_adc.h%3E%0A%0Auint16_t+adc_buffer%5B2%5D%5BDAT_BUFFER_SIZE%5D+__attribute__%28%28section%28%22.ARM.__at_0x30000000%22%29%29%29%3B++++%2F%2F+in+SRAM1+for+DMA+friendly%0Auint16_t+dac_buffer%5B2%5D%5BDAT_BUFFER_SIZE%5D+__attribute__%28%28section%28%22.ARM.__at_0x30000000%22%29%29%29%3B+%2F%2F+in+SRAM1+for+DMA+friendly%0Afloat+dds_sines%5B2%5D%5BTRIG_BUFFER_SIZE%5D%3B+++++%2F%2F__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0Afloat+dds_cosines%5B2%5D%5BTRIG_BUFFER_SIZE%5D%3B+%2F%2F__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0Auint32_t+dds_pa%5B2%5D%5BTRIG_BUFFER_SIZE%5D%3B+++++%2F%2F__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0A%0Afloat+fsin_table_16%5B65536%5D+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0Afloat+capture%5B65536%5D+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0A%0A%0A%0Abool+acq_running+%3D+false%3B%0A%0A%0A%0A%0A%0A%0A%2F%2F+CH1+is+ADC1+INP3+%28pins+30%2C31%29%0A%2F%2F+CH2+is+ADC2+INP4+%28pins+32%2C33%29%0A%0Avoid+adc_init%28void%29%0A%7B%0A__HAL_RCC_ADC12_CLK_ENABLE%28%29%3B%0AADC12_COMMON-%3ECCR+%3D+0x30000%3B++++++++++++%2F%2F+ADCs+independent+clock+mode+sync+divde+adc_hclk+by+4%2C+%28for+fADC+%3D+25MHz%29%0AADC1-%3ECR+%3D+0x50000100%3B++++++++++++++++++++++++%2F%2F+diff+mode+for+cal%2C+out+of+deep+power+down+and+boost+on%0AADC2-%3ECR+%3D+0x50000100%3B++++++++++++++++++++++++%2F%2F+diff+mode+for+cal%2C+out+of+deep+power+down+and+boost+on%0Adelay_us%2850%29%3B++++++++++++++++++++++++++++++++++++++++++++%2F%2F+10+should+be+enough%0AADC1-%3ECFGR+%3D+0x1583%3B++++++++++++++++++++++++++++%2F%2F+overwrite+mode%2C+external+trigger%2C+rising+edge%2C+TRG0+TIM4%2C+DMA+circ+mode+0001+0101+0110+0011%0AADC2-%3ECFGR+%3D+0x1583%3B++++++++++++++++++++++++++++%2F%2F+overwrite+mode%2C+external+trigger%2C+rising+edge%2C+TRG0+TIM4%2C+DMA+circ+mode+0001+0101+0110+0011+%0AADC1-%3ESMPR1+%3D+0x0800%3B++++++++++++++++++++++++++++%2F%2F+sample+time+32.5fADC+on+INP3%0AADC2-%3ESMPR1+%3D+0x4000%3B++++++++++++++++++++++++++++%2F%2F+sample+time+32.5fADC+on+INP4%0AADC1-%3ESQR1+%3D+0xc0%3B++++++++++++++++++++++++++++++++%2F%2F+reg+sequence+of+1+channel+at+input+3%0AADC2-%3ESQR1+%3D+0x0100%3B++++++++++++++++++++++++++++%2F%2F+reg+sequence+of+1+channel+at+input+4%0AADC1-%3ECR+%7C%3D+0x00010000%3B++++++++++++++++++++++++%2F%2F+linearity+%0AADC2-%3ECR+%7C%3D+0x00010000%3B++++++++++++++++++++++++%2F%2F+linearity+%0AADC1-%3ECR+%7C%3D+0x80000000%3B++++++++++++++++++++++++%2F%2F+do+cal%0AADC2-%3ECR+%7C%3D+0x80000000%3B++++++++++++++++++++++++%2F%2F+do+cal%0Adelay_us%2810%29%3B++++++++++++++++++++++++++++++++++++++++++++%2F%2F+give+ADC+time+to+notice+request%0Awhile%28%28ADC1-%3ECR+%26+0x80000000%29+%21%3D+0%29%7B%7D%3B%0Awhile%28%28ADC2-%3ECR+%26+0x80000000%29+%21%3D+0%29%7B%7D%3B++++++++%2F%2F+let+them+both+finish%0AADC1-%3EDIFSEL+%3D+0x08%3B++++++++++++++++++++++++++++%2F%2F+set+differential+mode+on+INP3%0AADC2-%3EDIFSEL+%3D+0x10%3B++++++++++++++++++++++++++++%2F%2F+set+differential+mode+on+INP4%0AADC1-%3EPCSEL+%3D+0x088%3B++++++++++++++++++++++++++++%2F%2F+set+the+pre+select+registers+for+input+3%2C+and+INP7+for+INP+3+diff%0AADC2-%3EPCSEL+%3D+0x110%3B++++++++++++++++++++++++++++%2F%2F+set+the+pre+select+registers+for+input+4%2C+and+INP8+for+INP+4+diff%0A++++%0AADC1-%3ECR+%7C%3D+1%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+enable+ADC++++%0AADC2-%3ECR+%7C%3D+1%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+enable+ADC++++%0Awhile%28%28ADC1-%3EISR+%26+1%29+%3D%3D+0%29%7B%7D%3B%0Awhile%28%28ADC2-%3EISR+%26+1%29+%3D%3D+0%29%7B%7D%3B++++++++%2F%2F+wait+for+both+to+be+ready%0A%2F%2FADC1-%3ECR+%7C%3D+4%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+start+the+ADC%0A%2F%2FADC2-%3ECR+%7C%3D+4%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+start+the+ADC%0A++++%0A%0A%7D%0A%0Avoid+init_dma%28void%29%0A%7B%0A%2F%2F+DMA1%2C+stream+0++ADC1%0A%2F%2F+DMA1%2C+stream+1++ADC2%0A%2F%2F+DMA2%2C+stream+0++DAC1%0A%2F%2F+DMA2%2C+stream+1++DAC2%0A++++%0A__HAL_RCC_DMA1_CLK_ENABLE%28%29%3B%0A__HAL_RCC_DMA2_CLK_ENABLE%28%29%3B%0A++++%0ADMA1_Stream0-%3ECR+%3D+0x00022d00%3B++++++++%2F%2F+dbm+%3D+off+priority+%3D+high%2Cmize+%3D+psize+%3D+01+for+16+bit%2C+minc+%3D+1%2Cpinc+%3D+0%2C+circ+%3D+1%2C+dir+%3D+00+pfctrl+%3D+0%2C+no+interrupts%2C+disabled++0000+0000+0000+0010+0010+1101+0000+0000%0ADMA1_Stream1-%3ECR+%3D+0x00022d00%3B%0ADMA2_Stream0-%3ECR+%3D+0x00032d40%3B++++++++%2F%2F+dbm+off%2C+priority+%3D+vhigh%2Cmize+%3D+psize+%3D+01+for+16+bit%2C+minc+%3D+1%2Cpinc+%3D+0%2C+circ+%3D+1%2C+dir+%3D+01+pfctrl+%3D+0%2C+no+interrupts%2C+disabled++0000+0000+0000+0111+0010+1101+0100+0000%0ADMA2_Stream1-%3ECR+%3D+0x00032d40%3B%0A%0ADMA1_Stream0-%3ENDTR+%3D+2048%3B%0ADMA1_Stream1-%3ENDTR+%3D+2048%3B%0ADMA2_Stream0-%3ENDTR+%3D+2048%3B%0ADMA2_Stream1-%3ENDTR+%3D+2048%3B%0A++++%0ADMA1_Stream0-%3EPAR+%3D+%28uint32_t%29+%26%28ADC1-%3EDR%29%3B%0ADMA1_Stream1-%3EPAR+%3D+%28uint32_t%29+%26%28ADC2-%3EDR%29%3B%0ADMA2_Stream0-%3EPAR+%3D+%28uint32_t%29+%26%28DAC1-%3EDHR12R1%29%3B%0ADMA2_Stream1-%3EPAR+%3D+%28uint32_t%29+%26%28DAC1-%3EDHR12R2%29%3B%0A%0ADMA1_Stream0-%3EM0AR+%3D+%28uint32_t%29+%26adc_buffer%5B0%5D%5B0%5D%3B%0ADMA1_Stream1-%3EM0AR+%3D+%28uint32_t%29+%26adc_buffer%5B1%5D%5B0%5D%3B%0ADMA2_Stream0-%3EM0AR+%3D+%28uint32_t%29+%26dac_buffer%5B0%5D%5B0%5D%3B%0ADMA2_Stream1-%3EM0AR+%3D+%28uint32_t%29+%26dac_buffer%5B1%5D%5B0%5D%3B%0A%2F%2FDMA2_Stream0-%3EM1AR+%3D+%28%28uint32_t%29+dac1_buffer%29+%2B+2048%3B%0A%2F%2FDMA2_Stream1-%3EM1AR+%3D+%28%28uint32_t%29+dac2_buffer%29+%2B+2048%3B%0A%0A%2F%2F+fifo+control+left+at+default+%28fifo+not+used%29%0A%0A%0ADMAMUX1_Channel0-%3ECCR+%3D+9%3B++++++++++++++++%2F%2F+sync+disabled+%2C+just+select+the+basic+mpx+input%0ADMAMUX1_Channel1-%3ECCR+%3D+10%3B%0ADMAMUX1_Channel8-%3ECCR+%3D+67%3B%0ADMAMUX1_Channel9-%3ECCR+%3D+68%3B%0A%0ADMA1_Stream0-%3ECR+%7C%3D+1%3B++++++++++++++++++++++++%2F%2F+Enable+DMA%0ADMA1_Stream1-%3ECR+%7C%3D+1%3B%0ADMA2_Stream0-%3ECR+%7C%3D+1%3B++++++++%0ADMA2_Stream1-%3ECR+%7C%3D+1%3B%0A%0A%7D%0A%0A%2F%2F+DELAY+FUNCTION%0A%2F%2F+Calibrated+for+STM32H743Zi+at+400MHz+internal+RC+clock+%0A%2F%2F+Optimisation+level+0+Compiler%3A+%27V5.06+update+6+%28build+750%29%27%2C+folder%3A+%27C%3A%5CKeil_v5%5CARM%5CARMCC%5CBin%27%0A%2F%2F+Driven+by+timer+5+so+pretty+much+as+good+as+uP+clock%0A%2F%2F+call+for+1+++++%2C+get+1.25%0A%2F%2F+call+for+10++++%2C+get+10%0A%2F%2F+call+for+100++++%2C+get+100.5%0A%2F%2F+call+for+500+%2C+get+500%0A%2F%2F+call+for+5000%2C+get+5000+%0A%0A%0A%23define+DELAY_US_MIN+1%0A%23define+DELAY_MULT+200%0A%23define+DELAY_DIV++1%0A%23define+DELAY_TRIM+50%0A%0Avoid+delay_us%28uint32_t+delay%29%0A%7B%0Avolatile+uint32_t+d%3B%0Auint32_t+dm%3B%0A%0Aif+%28delay+%3C+DELAY_US_MIN%29%0A++++%7B%0A++++return%3B%0A++++%7D%0Adm+%3D+delay+*+DELAY_MULT%3B%0A%2F%2Fdm+%2F%3D+DELAY_DIV%3B%0Adm+-%3D+DELAY_TRIM%3B%0ATIM5-%3ECNT+%3D+0%3B%0Awhile%28TIM5-%3ECNT+%3C+dm%29%7B%7D%3B%0A%7D%0A%0Avoid+delay_test%28void%29%0A%7B%0APIN_SET%28DB0%29%3B%0Adelay_us%281%29%3B%0APIN_CLR%28DB0%29%3B++++%0Adelay_us%281%29%3B%0A%0APIN_SET%28DB0%29%3B%0Adelay_us%2810%29%3B%0APIN_CLR%28DB0%29%3B++++%0Adelay_us%2810%29%3B%0A%0APIN_SET%28DB0%29%3B%0Adelay_us%28100%29%3B%0APIN_CLR%28DB0%29%3B++++%0Adelay_us%28100%29%3B%0A%0APIN_SET%28DB0%29%3B%0Adelay_us%28500%29%3B%0APIN_CLR%28DB0%29%3B++++%0Adelay_us%28500%29%3B%0A%0APIN_SET%28DB0%29%3B%0Adelay_us%285000%29%3B%0APIN_CLR%28DB0%29%3B++++%0Adelay_us%285000%29%3B%0A%7D%0A%0A%0A%0Avoid+init_acquisition%28void%29%0A%7B%0ATIM4-%3ECR1+%26%3D+0xfffffffe%3B++++++++++++++++++++%2F%2F+stop+timer%0ATIM2-%3ECR1+%26%3D+0xfffffffe%3B++++++++++++++++++++%2F%2F+stop+sample+counter%0ATIM2-%3ECNT+%3D+0%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+sample+count+set+to+zero%0ATIM4-%3ECNT+%3D+240%3B++++++++++++++++++++++++++++++++++++%2F%2F+preset+sample+timer%0An_written%5B0%5D+%3D+0%3B%0An_written%5B1%5D+%3D+0%3B%0An_read%5B0%5D+%3D+0%3B%0An_read%5B1%5D+%3D+0%3B%0Awhile%28%28ADC1-%3ECR+%26+4%29+%21%3D+0%29++++++++++++++++%2F%2F+wait+for+any+pending+conversion+to+end%0A++++%7B%7D%0Aif+%28%28ADC1-%3ECR+%26+1%29+%21%3D+0%29++++++++++++++++++++%2F%2F+if+ADC+is+enabled%0A++++%7B%0A++++ADC1-%3ECR+%7C%3D+2%3B++++++++++++++++++++++++++++++++++++%2F%2F+disable+it%0A++++while+%28%28ADC1-%3ECR+%26+1%29+%21%3D+0%29++++++++++++%2F%2F+wait+for+disable+to+work%0A++++++++%7B%7D++++++++%0A++++%7D%0Awhile%28%28ADC2-%3ECR+%26+4%29+%21%3D+0%29++++++++++++++++%2F%2F+wait+for+any+pending+conversion+to+end%0A++++%7B%7D%0Aif+%28%28ADC2-%3ECR+%26+1%29+%21%3D+0%29++++++++++++++++++++%2F%2F+if+ADC+is+enabled%0A++++%7B%0A++++ADC2-%3ECR+%7C%3D+2%3B++++++++++++++++++++++++++++++++++++%2F%2F+disable+it%0A++++while+%28%28ADC2-%3ECR+%26+1%29+%21%3D+0%29++++++++++++%2F%2F+wait+for+disable+to+work%0A++++++++%7B%7D++++++++%0A++++%7D%0ADMA1_Stream0-%3ECR+%26%3D+0xfffffffe%3B++++++++%2F%2F+Disable+all+DMA%0ADMA1_Stream1-%3ECR+%26%3D+0xfffffffe%3B%0ADMA2_Stream0-%3ECR+%26%3D+0xfffffffe%3B++++++++%0ADMA2_Stream1-%3ECR+%26%3D+0xfffffffe%3B%0A%0A++++++++%0A%7D%0A%0Avoid+start_acqusition%28void%29%0A%7B%0ADMA1-%3ELIFCR+%3D+0xf7d%3B++++++++++++++++++++++++++++%2F%2F+clear+stream+0+and+1+flags%0ADMA2-%3ELIFCR+%3D+0xf7d%3B++++++++++++++++++++++++++++%2F%2F+necessaary+before+re-starting+DMA%0A++++%0ADMA1_Stream0-%3ECR+%7C%3D+1%3B++++++++++++++++++++++++%2F%2F+Enable+DMA%0ADMA1_Stream1-%3ECR+%7C%3D+1%3B%0ADMA2_Stream0-%3ECR+%7C%3D+1%3B++++++++%0ADMA2_Stream1-%3ECR+%7C%3D+1%3B%0A%0AADC1-%3ECR+%7C%3D+1%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+enable+ADCs%0AADC2-%3ECR+%7C%3D+1%3B++++++++++++++++++++++++++++++++++++++++%0A%0Awhile%28%28%28ADC1-%3EISR+%26+1%29+%3D%3D+0%29%7C%7C%28%28ADC1-%3EISR+%26+1%29+%3D%3D+0%29%29%0A%7B%7D++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%2F%2F+wait+for+them+to+bee+ready%0A++++%0A++++%0A%0ATIM2-%3ECR1+%7C%3D+0x1%3B%0ATIM4-%3ECR1+%7C%3D+0x1%3B%0ADAC1-%3ECR+%7C%3D+0x10001%3B+++++++++++++++++++++++++++++%2F%2F+dacs+enabled%0AADC1-%3ECR+%7C%3D+4%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+start+the+ADC%0AADC2-%3ECR+%7C%3D+4%3B++++++++++++++++++++++++++++++++++++++++%2F%2F+start+the+ADC%0A%0Aacq_running+%3D+true%3B%0A%7D%0A%0Avoid+stop_acquisition%28void%29%0A%7B%0ATIM4-%3ECR1+%26%3D+0xfffffffe%3B%0Aacq_running+%3D+false%3B%0A%7D%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%2F%2F------------------------------------------------------------------------------------%0A%2F%2F+h7synth_adc.h%0A%2F%2F------------------------------------------------------------------------------------%0A%2F%2F+Copyright+2020+MK+ELECTRONICS+LTD%0A%2F%2F%0A%2F%2F+AUTH%3A+Michael+Kellett%0A%2F%2F+DATE+03%2F03%2F2020%0A%2F%2F%0A%2F%2F+H7+Synth+tester%0A%2F%2F%0A%2F%2F+Target++STM32H743Zi+on+MKE+H7SYNTH+board%0A%2F%2F%0A%2F%2F%0A%2F%2F%0A%2F%2F+Tool+chain++KEIL%0A%2F%2F%0A%0A%0A%2F%2F+Define+to+prevent+recursive+inclusion+%0A%23ifndef+H7SYNTH_ADC_H%0A%23define+H7SYNTH_ADC_H%0A%0A%23include+%3Cstdint.h%3E%0A%23include+%3Cstdbool.h%3E%0A%0A%2F%2F+GLOBAL+DEFNITIONS%0A%23define+DAT_BUFFER_SIZE+++++2048%0A%23define+TRIG_BUFFER_SIZE++++4096%0A%0A%2F%2F+FUNCTION+DECLARATIONS%0A%0Aextern+void+adc_init%28void%29%3B%0Aextern+void+delay_us%28uint32_t+delay%29%3B%0Aextern+void+delay_test%28void%29%3B%0Aextern+void+init_tim5%28void%29%3B%0Aextern+void+init_dma%28void%29%3B%0Aextern+void+init_acquisition%28void%29%3B%0Aextern+void+start_acqusition%28void%29%3B%0Aextern+void+stop_acquisition%28void%29%3B%0A%0A%0A%0A%2F%2F+GLOBAL+VARIABLES%0A%0Aextern+uint16_t+adc_buffer%5B2%5D+%5BDAT_BUFFER_SIZE%5D__attribute__%28%28section%28%22.ARM.__at_0x30000000%22%29%29%29%3B%0Aextern+uint16_t+dac_buffer%5B2%5D%5BDAT_BUFFER_SIZE%5D+__attribute__%28%28section%28%22.ARM.__at_0x30000000%22%29%29%29%3B%0Aextern+float+dds_sines%5B2%5D%5BTRIG_BUFFER_SIZE%5D%3B+%2F%2F+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0Aextern+float+dds_cosines%5B2%5D%5BTRIG_BUFFER_SIZE%5D%3B+%2F%2F+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0Aextern+uint32_t+dds_pa%5B2%5D%5BTRIG_BUFFER_SIZE%5D%3B+%2F%2F+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0A%0Aextern+float+fsin_table_16%5B65536%5D+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0Aextern+float+capture%5B65536%5D+__attribute__%28%28section%28%22.ARM.__at_0x24000000%22%29%29%29%3B%0A%0A%0A%0Aextern+bool+acq_running%3B%0A%0A%0A%23endif+%2F%2F++H7SYNTH_ADC_H]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Once every two ms a function checks the DMA buffers for content and processes whatever is there.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This code is work in progress - be very careful when using it that you fully undertsnad what it actually does , which may not be quite what the comments say &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/1817.contentimage_5F00_1.png:16:16]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Sun, 16 Aug 2020 04:31:50 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>abadialali</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am really interested in your project and I was wondering if there is an easy way to port it to portenta H7 which uses STM32h747. Also, what was the maximum sampling speed you were able to get and what was your maximum generated frequency? &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks, &lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Fri, 12 Jun 2020 02:05:49 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I was just taking a look at the Solartron paper in the blog post, and the block diagram (figure 5):&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x255/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/1004.contentimage_5F00_206307.png:620:255]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;It has similarities to the &amp;#39;N2PK VNA&amp;#39; &lt;a class="jive-link-wiki-small" href="/technologies/wireless/w/documents/4662/hf-vector-network-analyzer---theory-of-operation"&gt;HF Vector Network Analyzer - Theory of Operation&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x369/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/5826.contentimage_5F00_206308.png:620:369]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The main difference is that instead of two multipliers and averagers in the Solartron paper, it uses one, and switches the DDS phase instead. A bigger difference is that the N2PK uses a mixer type design instead of a multiplier, and cannot go down to very low frequencies (it has a lower limit of 50 kHz). Anyway, I thought I&amp;#39;d mention it in case there&amp;#39;s any ideas to glean from that project too. &lt;a class="jive-link-external-small" href="http://www.makarov.ca/download/vna/v5/sch_v50.zip" rel="nofollow ugc noopener" target="_blank"&gt;Schematics for the VNA project are here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;It is using 10-bit DDS (AD9851). Since the VNA is more RF-focused, it is designed around 50 ohm impedance, which is awkward for general impedance measurement. However, there&amp;#39;s a &lt;a class="jive-link-external-small" href="http://literature.cdn.keysight.com/litweb/pdf/5989-0258EN.pdf" rel="nofollow ugc noopener" target="_blank"&gt;Keysight document&lt;/a&gt; which discusses how to arrange a couple of transformers to measure vector voltage and current for a device-under-test, and it allows for a much wider impedance range. The &lt;a class="jive-link-external-small" href="http://www.n2pk.com/VNA/RFIV_Single_%20Detector_Switch_%20and_%20Sensors_V1c.pdf" rel="nofollow ugc noopener" target="_blank"&gt;circuit diagram for that so-called RF-IV method is here (PDF)&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;I tried that, this was the setup - not had a chance to annotate it, but basically at the top of the photo is the VNA with the white cables being DDS RF output, and RF detector input, the lower metal box is the RF-IV circuitry, and the brown cable marked DUT is going to the board at the lower-right, which is a test fixture/cal tool (gerbers for that are in the FPC1500 review &lt;a class="jive-link-roadTestReview" href="https://www.element14.com/community/roadTestReviews/2698/l/fpc1500-spectrum-analyzer-review"&gt;FPC1500 Spectrum Analyzer - Review&lt;/a&gt; ), it has open, short and 50 ohm load, and a location for soldering a component/network.&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x465/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/2772.contentimage_5F00_206309.jpg:620:465]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The results seem really nice, this is the measurement of a 12k 0805 thin film resistor (red line is the resistance, scale is on the left side):&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x364/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/0638.contentimage_5F00_206310.png:620:364]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;And this is a 1.2 ohm 0805 (I think 1% thick film but I can verify) resistor:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x364/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/7585.contentimage_5F00_206311.png:620:364]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;I still need to do more experiments, but so far so good so I suspect your solution since the core of it is based on a similar principle but using digital processing, is going to be fantastic, and will have the advantage of lower frequencies which I can&amp;#39;t explore with the VNA.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Mon, 06 Apr 2020 02:07:05 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>noorpuri</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice project.&amp;nbsp; I will try to run this code on my board.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Fri, 13 Mar 2020 11:15:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>cstanton</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nicely done &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-c5e51804-0b64-4708-8b44-9d192f36605a/contentimage_5F00_1.png:16:16]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Thu, 12 Mar 2020 22:15:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>jw0752</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for sharing your project build.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;John&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Tue, 10 Mar 2020 20:32:29 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>three-phase</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This is a very interesting project, I too will look forward to the updates as you progress this.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Kind regards.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Tue, 10 Mar 2020 18:08:52 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice project, I look forward to your build out and testing.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Tue, 10 Mar 2020 18:03:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>fmilburn</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Nice project.&amp;nbsp; Sometime back I entered a Project14 contest and won the grand prize which included the STM32 Nucleo board with the &lt;span style="font-style:inherit;font-weight:inherit;text-align:left;text-indent:0px;"&gt;STM32H743ZIT6U and 1MB ram.&amp;nbsp; I have never used it other than to test it by blinking a LED as it is overkill for the projects I normally attempt.&amp;nbsp; But I would like to follow along with you.&amp;nbsp; I normally use GCC and don&amp;#39;t have Keil but am interested in getting your code.&amp;nbsp; I should be able to build a filter similar to what you describe with parts on hand.&amp;nbsp; I won&amp;#39;t be able to keep up day to day due to personal matters at the moment but hope to be not too far behind.&amp;nbsp; Thanks for posting this.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-style:inherit;font-weight:inherit;text-align:left;text-indent:0px;"&gt;Frank&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: A simple frequency response analyser</title><link>https://community.element14.com/members-area/personalblogs/b/michael-kellett-s-blog/posts/a-simple-frequency-response-analyser</link><pubDate>Tue, 10 Mar 2020 17:58:24 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c5e51804-0b64-4708-8b44-9d192f36605a</guid><dc:creator>shabaz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Very interesting project! It could have great VNA-like or impedance meter capabilities with the phase measurement too. Looks like the ST parts are a nice alternative to the AD DDS chips for this, since those are more expensive. 12-bit DACs within a microcontroller, as well as high-res ADCs is a nice combination! &lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=8808&amp;AppID=323&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>