首先,我有个小问题,你要求算的是2+4+8+……+100,是不是2的1次方,2次方,3次方?如果是,那应该是2+4+8+16+32+64,怎么有还加100呢?或者你笔误,应该是2—100之间的偶数相加呢?
好,下面来解决你的问题:
1.用ADS1.2运行你的加法程序,要注意一点就是ADS不能直链接运行C遍出来的程序,要用汇编代码启动。下面是启动代码startup.s文件(我空间有关于这个代码的分析,你可以去看看):
IMPORT |Image$$RO$$Limit|
IMPORT |Image$$RW$$Base|
IMPORT |Image$$ZI$$Base|
IMPORT |Image$$ZI$$Limit|
IMPORT Main 声明C程序中的Main()函数
AREA Start,CODE,READONLY 声明代码段Start
ENTRY标识程序入口
CODE32声明32位ARM指令
Reset LDR SP,=0x40003F00
初始化C程序的运行环境
LDR R0,=|Image$$RO$$Limit|
LDR R1,=|Image$$RW$$Base|
LDR R3,=|Image$$ZI$$Base|
CMP R0,R1
BEQ LOOP1
LOOP0 CMP R1,R3
LDRCC R2,[R0],#4
STRCC R2,[R1],#4
BCC LOOP0
LOOP1 LDR R1,=|Image$$ZI$$Limit|
MOV R2,#0
LOOP2 CMP R3,R1
STRCC R2,[R3],#4
BCC LOOP2
B Main 跳转到C程序代判差码Main()函数
END
2. 启动代码写好后,再编写C代码,运行你的程序(按你的意思算)
#define uint8 unsigned char //这两个宏定义是ADS里面防止数据溢迹冲好出带的
#define uint32 unsigned int
#define N 100
uint32 sum
// 使用加法运算来计算2+4+8+……+N的值。
void Main(void)
{ uint32 i
sum = 0
for(i=0i<=Ni=i*2)
{ sum += i
}
while(1)
}
3. 这两个程序合在一起才是是完整的ADS实现程序,希望可以解决你的困惑。姿铅
祝你进步!
ADS(先进设计系统)在Beckhoff TwinCAT 系统中,各个软件模块(如TwinCAT PLC、TwinCAT NC、Windows 应用程序等)的工作模式类似于硬件设备,它们能够独立工作。
各个软件模块之间的信息交换通过TwinCAT ADS 而完成。ADS(Advanced Design System)即先进设计系统,它为设备之间的通讯提供路由。在TwinCAT PC 和Beckhoff 的CX、BX、BC 系列控制器中都包含TwinCAT 信息路由器。因此各个ADS 设备之间都能够交换数据和信息。
扩展资料:
通过从频域和时域电路仿真到电磁场仿真的全套仿真技术,ADS让设计师弊缺全面改氏表征和优化设计。单一的集成设计环境提供系统和电路仿真器,以及电路图捕获、布局和验证能力 —— 因此不需要在设计中停下来更换设计工具。
先进设计系统是强大的电子设计自核卜散动化软件系统。它为蜂窝和便携电话、寻呼机、无线网络,以及雷达和卫星通信系统这类产品的设计师提供完全的设计集成。
参考资料来源:百度百科-ADS
参考资料来源:百度百科-仿真技术
TI公司的ADS8688是基于16位逐次逼近(SAR)模数转换器(ADC)的八路数据采集系统,工作在500kSPs的吞吐量.双核猜极工作电源±10.24 V,±5.12 V和±2.56 V,单极工作电源0 V 到 10.24 V和0 V到5.12 V,输出保护电压高达成±20 V,低功耗65mW,具有极好的性能: SNR: 92 dBTHD:–102 dB.主要用于工业控制,PLC和数据采集系统.本文改扰型介绍了ADS8688主要特李卜性,框图,以及在电源自动化和PLC的数据采集系统框图, ADS8688EVM-PDK 评估模块主要特性和GUI主要特性,电路图,材料清单和六层PCB设计图.The ADS8684 and ADS8688 are 4- and 8-channel, integrated data acquisition systems based on a 16-bit successive approximation (SAR) analog-to-digital converter (ADC), operating at a throughput of 500 kSPS. The devices feature integrated analog front-end circuitry for each input channel with overvoltage protection up to ±20 V, a 4- or 8-channel multiplexer with automatic and manual scanning modes, and an on-chip, 4.096-V reference with low temperature drift. Operating on a single 5-V analog supply, each input channel on the devices can support true bipolar input ranges of ±10.24 V, ±5.12 V, and ±2.56 V, as well as unipolar input ranges of 0 V to 10.24 V and 0 V to 5.12 V. The gain of the analog front-end for all input ranges is accurately trimmed to ensure a high dc precision. The input range selection is software-programmable and independent for each channel. The devices offer a 1-MΩ constant resistive input impedance irrespective of the selected input range.
The ADS8684 and ADS8688 offer a simple SPI-compatible serial interface to the digital host and also support daisy-chaining of multiple devices. The digital supply operates from 1.65 V to 5.25 V, enabling direct interface to a wide range of host controllers.
ADS8688主要特性:
16-Bit ADC with Integrated Analog Front-End
4-, 8-Channel MUX with Auto and Manual Scan
Channel-Independent Programmable Input Ranges:
Bipolar: ±10.24 V, ±5.12 V, and ±2.56 V
Unipolar: 0 V to 10.24 V and 0 V to 5.12 V
5-V Analog Supply: 1.65-V to 5-V I/O Supply
Constant Resistive Input Impedance: 1 MΩ
Input Overvoltage Protection: Up to ±20 V
On-Chip, 4.096-V Reference with Low Drift
Excellent Performance:
500-kSPS Aggregate Throughput
DNL: ±0.5 LSBINL: ±0.75 LSB
Low Drift for Gain Error and Offset
SNR: 92 dBTHD: –102 dB
Low Power: 65 mW
AUX Input → Direct Connection to ADC Inputs
SPI™-Compatible Interface with Daisy-Chain
–40℃ to 125℃ Industrial Temperature Range
TSSOP-38 Package (9.7 mm × 4.4 mm)
图1. ADS8688功能框图
图2. 用于电源自动化的ADS8688八路复用数据采集系统框图
图3. 用于PLC的ADS8688 16位八路综合模拟输出模块框图
ADS8688EVM-PDK 评估模块
The ADS8688EVM-PDK is a platform for evaluating the ADS8688 device. The ADS8688EVM-PDK consists of an ADS8688EVM board and an SDCC controller card. The SDCC is an FPGA-based controller card that functions as an serial peripheral interface (SPI™) host and transfers data to the ADS8688EVM graphical user interface (GUI) via a USB interface. The ADS8688EVM GUI collects, analyzes, and records data from the ADS8688EVM board. The ADS8688EVM GUI is capable of collecting data from the ADS8688EVM in auto and manual modes, configuring the ADC program registers, and performing FFT analysis of data captured from the ADC.
ADS8688EVM-PDK 评估模块主要特性:
• Includes support circuitry as a design example to match ADC performance.
• 3.3-V slave SPI.
• Serial interface header for easy connection to the SDCC controller card.
• Designed for a 5-V analog supply.
• Integrated 4.096-V voltage reference.
• Bipolar (±10.24 V, ±5,12 V, ±2.56 V )or unipolar(0 V to 10.24 V, 0 V to 5.12 V) input ranges for each channel.
• Onboard, second-order, Butterworth, low-pass filters for four channels.
• Onboard regulator for generating a ±15-V bipolar supply for second-order, Butterworth, low-pass filters.
• Capable of accepting a ±100-mV signal on the negative analog inputs (AIN_xGND).
ADS8688EVM-PDK 评估模块GUI特性:
• Captures data from the ADS8688EVM in auto and manual modes.
• Configures the ADS8688 device program registers.
• Enables and disables channels in auto mode.
• FFT analysis and calculates the SNR, THD, and SINAD ac performance parameters.
• Single and multiple graph views for captured data.
• Includes a dc histogram for dc inputs.
• Logs ADC data.
图4.ADS8688EVM-PDK 评估模块外形图: microSD存储卡和SDCC控制板
The ADS8688EVM-PDK includes microSD memory cards that contain the EVM software and SDCC controller board firmware required for the EVM operation
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)