找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

帖子
查看: 2067|回復(fù): 3
收起左側(cè)

arduino的SAMD21G18內(nèi)置AD的采樣率多少?

[復(fù)制鏈接]
ID:948592 發(fā)表于 2021-7-4 19:38 | 顯示全部樓層 |閱讀模式
這家介紹該MCU內(nèi)置AD通過(guò)函數(shù)可以控制至12位
(請(qǐng)手工把點(diǎn)替換成.)鏈接:dronebotworkshop點(diǎn)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.


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





回復(fù)

使用道具 舉報(bào)

ID:123289 發(fā)表于 2021-7-5 09:59 | 顯示全部樓層
SAMD21G18的手冊(cè)上,關(guān)于AD采樣的時(shí)鐘部分是怎么說(shuō)的呢?
回復(fù)

使用道具 舉報(bào)

ID:948592 發(fā)表于 2021-7-5 10:36 | 顯示全部樓層
yzwzfyz 發(fā)表于 2021-7-5 09:59
SAMD21G18的手冊(cè)上,關(guān)于AD采樣的時(shí)鐘部分是怎么說(shuō)的呢?

說(shuō)明書忘了看,復(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

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

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

謝謝提醒
回復(fù)

使用道具 舉報(bào)

ID:948592 發(fā)表于 2021-7-5 10:42 | 顯示全部樓層
yzwzfyz 發(fā)表于 2021-7-5 09:59
SAMD21G18的手冊(cè)上,關(guān)于AD采樣的時(shí)鐘部分是怎么說(shuō)的呢?

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

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表