找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1441|回复: 3
打印 上一主题 下一主题
收起左侧

arduino的SAMD21G18内置AD的采样率多少?

[复制链接]
跳转到指定楼层
楼主
ID:948592 发表于 2021-7-4 19:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这家介绍该MCU内置AD通过函数可以控制至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. }
复制代码
摘录: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 ?
找了一圈,没找到怎么控制采样率





分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:123289 发表于 2021-7-5 09:59 | 只看该作者
SAMD21G18的手册上,关于AD采样的时钟部分是怎么说的呢?
回复

使用道具 举报

板凳
ID:948592 发表于 2021-7-5 10:36 | 只看该作者
yzwzfyz 发表于 2021-7-5 09:59
SAMD21G18的手册上,关于AD采样的时钟部分是怎么说的呢?

说明书忘了看,复制了一段英文:
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应该是指这些,我不太会看英文说明书
附链接:(请手工把点替换成.)files.seeedstudio点com/wiki/Seeeduino-XIAO/res/ATSAMD21G18A-MU-Datasheet.pdf
ADC描述位于第863页

要描述属实,adc采样率挺不错。。。淘宝卖模数转换器ads1015 12位采样率3300SPS,价格18~25元一小片,这SAMD21G18集成了ad、da、48MHZ主频、256kb等,作为arduino硬件,它的价格38~45挺便宜了嗯,和隔壁百元STM开发板比较的

谢谢提醒
回复

使用道具 举报

地板
ID:948592 发表于 2021-7-5 10:42 | 只看该作者
yzwzfyz 发表于 2021-7-5 09:59
SAMD21G18的手册上,关于AD采样的时钟部分是怎么说的呢?

至于时钟我没啥看法,手册第874描述同步可以看看,我只是把传感器套在模拟通道,直接用几行代码读取数值的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表