Introduction

This page describes how to test the features of the SAMA5D2-compatible ADC device. This driver uses the Industrial Input/Output (IIO) subsystem.

Documentation for the IIO subsystem is available in the kernel source code directory: drivers/staging/iio/Documentation and Documentation/iio.

Kernel

The driver (features are added little by little) for the SAMA5D2-compatible ADC device is available on:

The ADC drivers is automatically selected if you use sama5_defconfig. Otherwise, check you have set CONFIG_AT91_SAMA5D2_ADC.

To check that ADC driver is correclty loaded:

# dmesg|grep at91-sama5d2_adc
at91-sama5d2_adc fc030000.adc: version: 800
# ls /sys/bus/iio/devices/iio\:device0
dev in_voltage2_raw in_voltage8_raw
in_voltage-voltage_scale in_voltage3_raw in_voltage9_raw
in_voltage0-voltage1_raw in_voltage4-voltage5_raw in_voltage_scale
in_voltage0_raw in_voltage4_raw name
in_voltage10-voltage11_raw in_voltage5_raw of_node
in_voltage10_raw in_voltage6-voltage7_raw power
in_voltage11_raw in_voltage6_raw sampling_frequency
in_voltage1_raw in_voltage7_raw subsystem
in_voltage2-voltage3_raw in_voltage8-voltage9_raw uevent

Tips: The ADC controller doesn't manage its pins in the same way as other ones. PIOs can't be assigned to it. It will automatically use them (if not assigned to another peripheral) when enabling the corresponding channel. To reserve PIOs for the ADC, you could declare them as GPIO in the device tree. By doing this, if there is a conflict with another peripheral, you'll be warned. You should also disable pull-up and pull-down to have coherent measurement when the PIO is not used by the ADC device. Here is an exemple from at91-sama5d2_xplained.dts for AD4 signal:

pinctrl_adc_default: adc_default {
pinmux = <PIN_PD23__GPIO>;
bias-disable;
};

Software triggers

Unsigned single-ended channel conversion

Setup

  • Connect a waveform or DC generator to the pin 4 of J8 connector called A3. You can also use a resistor bridge as the image below shows

Test procedure

  • request the conversion:
# cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw
3693
  • request the scale:
# cat /sys/bus/iio/devices/iio\:device0/in_voltage_scale
0.805664062
  • check the conversion by multiplying the conversion value with the scale:
3693 x 0.8 = 2954.4 mV

Signed differential channel conversion

Setup

Use A3 (AD4) and A6 (AD5) from J8 connector

Test procedure

  • request the conversion:
# cat /sys/bus/iio/devices/iio\:device0/ in_voltage4-voltage5_raw
-396
  • request the scale:
# cat /sys/bus/iio/devices/iio\:device0/in_voltage-voltage_scale
1.611328125
  • check the conversion by multiplying the conversion value with the scale:
-396 x 1.6 = -633,6 mV
  • you can compare it manually with the help of single ended conversions:
# cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw
1237
# cat /sys/bus/iio/devices/iio\:device0/in_voltage5_raw
2031
# cat /sys/bus/iio/devices/iio\:device0/in_voltage_scale
0.805664062
(1237-2031) x 0.8 = -635.2 mV

Using the SAMA5D2-compatible ADC device的更多相关文章

  1. mini2440驱动奇谭——ADC驱动与測试(动态挂载驱动)

    博客:http://blog.csdn.net/muyang_ren 实现功能:开发板动态载入adc驱动模块并能通过測试程序 系统:Ubuntu 14.04     驱动交叉编译内核:linux-2. ...

  2. linux 混杂设备驱动之adc驱动

    linux2.6.30.4中,系统已经自带有了ADC通用驱动文件---arch/arm/plat-s3c24xx/adc.c,它是以平台驱动设备模型的架构来编写的,里面是一些比较通用稳定的代码,但是l ...

  3. [dpdk] 熟悉SDK与初步使用 (一)(qemu搭建实验环境)

    搭建实验环境: troubleshoot 第一步加载驱动 第二步切换驱动 使用了所有qemu支持的卡 [tong@T7:~/VM/dpdk] % cat start.sh sudo qemu-syst ...

  4. Linux内核Makefile文件(翻译自内核手册)

    --译自Linux3.9.5 Kernel Makefiles(内核目录documention/kbuild/makefiles.txt) kbuild(kernel build) 内核编译器 Thi ...

  5. [dpdk] 读官方文档(2)

    续前节.切好继续: 一,文档里提到uio_pci_generic, igb_uio, vfio_pci三个内核模块,完全搞不懂,以及dpdk-devbind.py用来查看网卡状态,我得到了下边的输出: ...

  6. 通过 Autostereograms 案例学习 OpenGL 和 OpenCL 的互操作性

    引言 在过去的十年里, GPU (图形处理单元)已经从特殊硬件(特供)转变成能够在数值计算领域开辟新篇章的高性能计算机设备. 很多算法能够使用拥有巨大的处理能力的GPU来快速运行和处理大数据量.即使在 ...

  7. Linux Kernel的Makefile与Kconfig文件的语法

    https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt Introduction ------------ The c ...

  8. Exiting the Matrix: Introducing Metasploit's Hardware Bridge

    Metasploit is an amazing tool. You can use it to maneuver through vast networks, pivoting through se ...

  9. AI_ 视频监控-人体移动捕捉监测

    总目录地址:AI 系列 总目录 需要最新源码,或技术提问,请加QQ群:538327407 我的各种github 开源项目和代码:https://github.com/linbin524 需求 为了实现 ...

随机推荐

  1. 还没被玩坏的robobrowser(8)——robobrowser的实现原理

    背景 学习使用工具实际上不难,不过我们应该通过阅读工具源码来提升自己的水平. 多读代码,读好代码.很不错,robobrowser的代码简单易懂,值得学习. 预备知识 源码地址 一起其实是从browse ...

  2. 查看指定java进程的jvm参数配置命令之jinfo

    一.查看所有的参数 jinfo -flags PS:3739为JAVA进程ID Attaching to process ID , please wait... Debugger attached s ...

  3. SIMULINK的模块库介绍

    SIMILINK模块库按功能进行分为以下8类子库:Continuous(连续模块)Discrete(离散模块)Function&Tables(函数和平台模块)Math(数学模块)Nonline ...

  4. windows 中安装及使用 SSH Key

    转自 简书技术博客:https://www.jianshu.com/p/a3b4f61d4747 联系管理员开通ssh功能: 重新创建环境: 下载工具包到本地机器wsCli 0.4 解压后,把相应的w ...

  5. [转]JSON Web Token - 在Web应用间安全地传递信息

    JSON Web Token(JWT)是一个非常轻巧的规范.这个规范允许我们使用JWT在用户和服务器之间传递安全可靠的信息. 让我们来假想一下一个场景.在A用户关注了B用户的时候,系统发邮件给B用户, ...

  6. Knockout: 实践CSS绑定和afterkeydown事件, 给未通过校验的输入框添加红色边框突出显示; 使用afterkeydown事件自动将输入转大写字母.

    目的: 实践一下Knockout提供的CSS绑定功能和afterkeydown事件. 步骤: 先在htm中添加.error的css样式, 并在输入框中绑定css: { error: !firstNam ...

  7. 使用git上传项目到码云

    一.git安装 1.首先在官方网站下载git工具,或者根据以下链接进行下载:http://download.csdn.net/detail/qq_27501889/9788879(此链接版本为git- ...

  8. MySql(十六):MySql架构设计——MySQL Cluster

    前言: MySQL Cluster 是一个基于 NDB Cluster 存储引擎的完整的分布式数据库系统.不仅仅具有高可用性,而且可以自动切分数据,冗余数据等高级功能.和 Oracle Real Cl ...

  9. Java:concurrent包下面的Collection接口框架图( CopyOnWriteArraySet, CopyOnWriteArrayList,ConcurrentLinkedQueue,BlockingQueue)

    Java集合大致可分为Set.List和Map三种体系,其中Set代表无序.不可重复的集合:List代表有序.重复的集合:而Map则代表具有映射关系的集合.Java 5之后,增加了Queue体系集合, ...

  10. 利用sdkman安装kotlin和java环境

    如果想在命令行下面运行kotlin程序,最省事的办法就是用sdkman来安装了: 1.安装sdkman: curl -s "https://get.sdkman.io" | bas ...