概述
这Analog Shield offers a high fidelity and easy way to connect your Arduino™ or chipKIT™ to analog circuits. In order to do this, the Digilent Analog Shield* provides:
Figure 1. The Analog Shield.
特征
-
4 Channel, 16 bit 100 ks/s SARADC.
-
4 Channel 16 bit 100 ks/s stringDAC.
-
Variable +/-7.5V Supply.
-
Fixed +/-5V Supply.
-
A small breadboard.
-
软件读写到ADC/DACwith a single line of C.
除了在其他原型设计或面包板屏蔽上提供的许多功能外,该屏蔽还提供比Arduino Uno™或Chipkit UNO32™的更具敏感的输入和输出,以及提供推动许多的双极输入和电源有用的模拟电路。模拟屏蔽使用SPI通信协议与Arduino通信。模数转换器(ADC)和数模转输出转换器(DAC) both use the standard Arduino form factor SPI bus pins and use independent chip selects.
应用程序
模拟屏蔽允许使用Arduino上的标准销可以可靠地记录或生成更好的分辨率,以便无法可靠地记录或生成。已经开发了一些使用模拟屏蔽的演示:正弦波/功能发生器(使用直接数字合成)。FFT频谱分析仪。复音音乐一代。4通道低带宽示波器。Lissajou图发电机。XY-模拟范围显示驱动程序。
这些演示各自在他们自己的相关文档中解释。
硬件
1.模拟转换器(ADC)标题
这2×4 header has the fourADC电路板上的公共地的通道和四个引脚。4个接地销位于标题的外行,而4ADC通道位于标题的内部行上。这ADC可以使用Analog.read()函数以16位以16位读取4频道的数据,该函数用A0-A3标记。有关更详细的op-amp电路的详细信息ADC,请参阅屏蔽原理图。
2. Digital to Analog Converter (DAC) Header
这2×4 header has the fourDAC电路板上的公共地的通道和四个引脚。4个接地销位于标题的外行,而4DAC通道位于标题的内部行上。这DAC修改来自Arduino或Chipkit产生的模拟信号。标准Arduino / Chipkit AnigwWrite()函数产生脉冲宽度调制(PWM)方波,其随时间近似于所需的总值。PWM对于许多应用程序是可以接受的,如调情A.引领or driving a motor, but it is not adequate for more sensitive analog circuits. Once a value is set to aDAC通道,通道将产生与提供的值对应的稳定电压。使用模拟IWRITE()函数促进了通道上的设置值,并且频道标记为D0-D4。有关OP-AMP电路的更多详细信息DAC,请参阅屏蔽原理图。
3.电源标题
这2×5 header has a positive 5V rail, a negative 5V rail, a positive variable voltage rail, a negative voltage rail, 2.5V reference voltage rail, and five pins for the common ground on the board. The 5 ground pins are on the outside row of the header while the 5 power supplies are on the inner row of the header. The +/-5V rail can vary due to USB power specification. The +/-Vadj rails can be adjusted using the variable voltage potentiometer located at the lower right corner of the shield. Adjusting the potentiometer will change the voltages of the +/-Vadj rails. There is also a +2.5V rail to be used as a reference voltage.
4. Voltage Select Jumper
这jumper needs to be set for whether the connected board uses IOREF, 3V3, or 5V0 for the I/O for the SPI interface.
5.可变电压电位计
电位器可用于调整+/- VADJ电源轨道。
软件
包含在模拟屏蔽中的简单库,可用于优化可读性和性能。它试图提供与IDE中已存在的标准模拟读取和写入功能类似的接口。安装库的说明包含在库文件夹中,并在“模拟屏蔽 - 02第一次设置”文档中。在成功将库安装到IDE中后,可以使用命令调用库:
#include
Once the analogShield library is included, a class variable called analog will be accessible. The analog variable will allow access to the analogShield library functions.
To sample one of the analog input channels, use the function below. read() returns the voltage read on the channel. The voltage is returned in a binary representation from 0 to 65535 for -5V to 5V.
无符号㈡读(㈡channel,BOOL模式=错误的);
要从频道0读取(没有差异模式)语法将如下所示:
无符号㈡数据;数据=analog.读(0);
该方法样品选择的模拟输入。“莫de’ is an optional parameter. False (the default value) is the normal, single-ended mode where each analog pin is referenced to ground. True enables ‘differential’ mode, where the value returned is the difference between the voltages on pairs of adjacent inputs (i.e., A0-A1 and A2-A3). signedRead() acts the same at read() but returns a signed integer.
signedRead(㈡channel,BOOL模式=错误的);
要从频道0读取(没有差异模式)语法将如下所示:
㈡数据;数据=analog.读(0);
将数据写入DAC,有一个名为write()的函数。此功能允许用户写入任何频道:通道0和1;通道0,1和2;或通道0,1,2和3。
write(㈡channel,无符号㈡价值);write(无符号㈡价值0,无符号㈡价值1,BOOL模式);write(无符号㈡价值0,无符号㈡价值1,无符号㈡价值2,BOOL模式);write(无符号㈡价值0,无符号㈡价值1,无符号㈡价值2,无符号㈡价值3,BOOL模式);
To write a value just for channel 1, the syntax will look like this:
无符号㈡数据=65535;analog.write(1,数据);
To write multiple values to channels 0, 1, and 2 and have them update at the same:
无符号㈡数据0=65535;无符号㈡数据1=256;无符号㈡数据2=0;analog.write(数据0,数据1,数据2,真的);
同时更新方法对于频道输出之间的小延迟产生不需要的信号或定时问题,可同时更新方法是有用的。例如,要使用屏蔽驱动示波器的X-Y输入来绘制一个圆圈,写入X和Y通道之间的延迟产生x和y之间的临时期间绘制的幽灵“椭圆”DACupdates. This is a simple but powerful library to help the user get started. It is well documented to ease modification of the library for any individual project. The power supply is entirely analog, and as such, needs no software to operate. However, theDAC(部件号DAC8564)和ADC(part number ADS8343) are both SPI devices. Their datasheets are freely available on the manufacturer’s webpage.
概括
Unlike the native analog input of the Arduino, the Analog Shield provides a 16 bitADC, (as opposed to 10bits provided by the Arduino UNO and the ChipKIT UNO32) offering greater precision (about 25dB) than the Arduino or chipKIT. Additionally, theADCworks as a bipolar input, meaning that sense signals in the range of +/-5V can be sensed without any additional hardware. The onboardDACprovides a similar improvement in precision. The Analog Shield provides 16 bits of precision, and offers as much as 25dB better signal-to-noise ratio when driving a sinusoidal output at low frequency. The Analog Shield provides a compact integrated power supply with fixed and adjustable outputs to allow a variety of analog circuits to be assembled with a minimum of wasted space and complexity. Special thanks to Gregory Kovacs, Fernando Mujica, Clint Cole, and their respective teams at Stanford, TI, and Digilent for supporting this project to its completion!