標(biāo)題: arduino的SAMD21G18內(nèi)置AD的采樣率多少? [打印本頁]

作者: allrobot    時間: 2021-7-4 19:38
標(biāo)題: arduino的SAMD21G18內(nèi)置AD的采樣率多少?
這家介紹該MCU內(nèi)置AD通過函數(shù)可以控制至12位
(請手工把點替換成.)鏈接:dronebotworkshop點com/seeeduino-xiao-intro/
  1. // Analog Input Pin
  2. #define ANALOG_IN_PIN A2

  3. // Integer to represent input value
  4. int input_val;

  5. void setup()
  6. {
  7.   // Set A/D converter resolution to 12-bits
  8.   analogReadResolution(12);
  9.   
  10.   // Setup Serial Port
  11.   SerialUSB.begin(9600);
  12. }

  13. void loop()
  14. {
  15.   // Read the input value
  16.   input_val = analogRead(ANALOG_IN_PIN);  
  17.   
  18.   
  19.   // Print value to Serial Monitor
  20.   SerialUSB.println(input_val);
  21.   
  22.   // Slight delay before repeating
  23.   delay(10);
  24.   
  25. }
復(fù)制代碼
摘錄:You can experiment with the analogReadResolution function and set it to different values to see the result. If set to 10 (or if the statement is eliminated) the output will range from 0 to 1023.


是否說明采樣率0~1023 SPS ?
找了一圈,沒找到怎么控制采樣率






作者: yzwzfyz    時間: 2021-7-5 09:59
SAMD21G18的手冊上,關(guān)于AD采樣的時鐘部分是怎么說的呢?
作者: allrobot    時間: 2021-7-5 10:36
yzwzfyz 發(fā)表于 2021-7-5 09:59
SAMD21G18的手冊上,關(guān)于AD采樣的時鐘部分是怎么說的呢?

說明書忘了看,復(fù)制了一段英文:
Features
• Processor
– ARM Cortex-M0+ CPU running at up to 48MHz
• Single-cycle hardware multiplier
• Micro Trace Buffer (MTB)
• Memories
– 32/64/128/256KB in-system self-programmable Flash
– 4/8/16/32KB SRAM Memory
• System
– Power-on reset (POR) and brown-out detection (BOD)
– Internal and external clock options with 48MHz Digital Frequency
Locked Loop (DFLL48M) and 48MHz to 96MHz Fractional Digital
Phase Locked Loop (FDPLL96M)
– External Interrupt Controller (EIC)
– 16 external interrupts
– One non-maskable interrupt
– Two-pin Serial Wire Debug (SWD) programming, test and
debugging interface
• Low Power
– Idle and standby sleep modes
– SleepWalking peripherals
Atmel-42181J-SAM D21_Datasheet_Complete-07/2016
• Peripherals
– 12-channel Direct Memory Access Controller (DMAC)
– 12-channel Event System
– Up to five 16-bit Timer/Counters (TC), configurable as either:
• One 16-bit TC with two compare/capture channels
• One 8-bit TC with two compare/capture channels
• One 32-bit TC with two compare/capture channels, by using two TCs
– Three 24-bit Timer/Counters for Control (TCC), with extended functions:
• Up to four compare channels with optional complementary output
• Generation of synchronized pulse width modulation (PWM) pattern across port pins
• Deterministic fault protection, fast decay and configurable dead-time between
complementary output
• Dithering that increase resolution with up to 5 bit and reduce quantization error
– 32-bit Real Time Counter (RTC) with clock/calendar function
– Watchdog Timer (WDT)
– CRC-32 generator
– One full-speed (12Mbps) Universal Serial Bus (USB) 2.0 interface
• Embedded host and device function
• Eight endpoints
– Up to six Serial Communication Interfaces (SERCOM), each configurable to operate as
either:
• USART with full-duplex and single-wire half-duplex configuration
• I2C up to 3.4MHz
• SPI
• LIN slave
– One two-channel Inter-IC Sound (I 2 S) interface
– One 12-bit, 350ksps Analog-to-Digital Converter (ADC) with up to 20 channels
• Differential and single-ended input
• 1/2x to 16x programmable gain stage
• Automatic offset and gain error compensation
• Oversampling and decimation in hardware to support 13-, 14-, 15- or 16-bit resolution
– 10-bit, 350ksps Digital-to-Analog Converter (DAC)
– Two Analog Comparators (AC) with window compare function
– Peripheral Touch Controller (PTC)
• 256-Channel capacitive touch and proximity sensing

它們說的特征是SAM D21E / SAM D21G / SAM D21J,ADC12位、350ksps應(yīng)該是指這些,我不太會看英文說明書
附鏈接:(請手工把點替換成.)files.seeedstudio點com/wiki/Seeeduino-XIAO/res/ATSAMD21G18A-MU-Datasheet.pdf
ADC描述位于第863頁

要描述屬實,adc采樣率挺不錯。。。淘寶賣模數(shù)轉(zhuǎn)換器ads1015 12位采樣率3300SPS,價格18~25元一小片,這SAMD21G18集成了ad、da、48MHZ主頻、256kb等,作為arduino硬件,它的價格38~45挺便宜了嗯,和隔壁百元STM開發(fā)板比較的

謝謝提醒
作者: allrobot    時間: 2021-7-5 10:42
yzwzfyz 發(fā)表于 2021-7-5 09:59
SAMD21G18的手冊上,關(guān)于AD采樣的時鐘部分是怎么說的呢?

至于時鐘我沒啥看法,手冊第874描述同步可以看看,我只是把傳感器套在模擬通道,直接用幾行代碼讀取數(shù)值的




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1