×

加入时间:清华大学2007年01月25日下午3:33

消耗积分:2 | 格式:pdf | 大小:68.39KB | 2021-03-22

分享资料个

This version (25 Jan 2021 11:17) was approved by Ioana Chelaru.The Previously approved version (14 Jan 2021 05:11) is available.Diff

AD738x - No-OS Driver

Supported Devices

Evaluation Boards

Overview

The AD7380, AD7381,AD7383,AD7384,AD7386, AD7387 and AD7388, are a 16-bit, 14-bit and 12- bit pin compatible family of dual simultaneous sampling, high speed, low power, successive approximation analog-to-digital converters (ADC) that operate from a 3.3 V power supply and features throughput rates up to 4 MSPS. The analog input type is differential for the AD7380 and AD7381,can accept a wide common mode input voltage and are sampled and converted on the falling edge of CS. The AD7383 and AD7383 have the pseudo-differential input while the AD7386, AD7387 and AD7388 have single-ended input. The AD7380, AD7381,AD7383,AD7384,AD7386, AD7387 and AD7388 family has optional integrated on-chip oversampling blocks to improve dynamic range and reduce noise at lower bandwidths. An internal 2.5 V reference is included.

Alternatively, an external reference up to 3.3 V can be used. The conversion process and data acquisition use standard control inputs allowing for easy interfacing to microprocessors or DSPs. It is compatible with 1.8 V, 2.5 V, 3.3 V interfaces, using the separate logic supply.

The dual AD7380, AD7381,AD7383,AD7384,AD7386, AD7387 and AD7388 family is available in a 16-lead 3mm x 3mm LFCSP package with operation specified from −40°C to +125°C.

Applications

  • Motor control position feedback
  • Motor control current sense
  • Data acquisition systems
  • EDFA applications
  • I and Q demodulation
  • SONAR
  • Power Quality

HDL Design Description

In the ADI Reference Designs HDL User Guide can be found an in-depth presentation and instructions about the HDL design in general.

The reference design uses the standard SPI Engine Framework with an integrated pulse generator, which will provide the required conversion rate for the ADC.

In order to build the HDL design the user has to go through the following steps:

  1. Confirm that you have the right tools (the reference design requires Vivado 2018.3)
  2. Clone the HDL GitHub repository (the project is located at ad738x_fmc)

Software Setup

In order to perform the software setup the user has to go through the following steps:

  1. Confirm that you have the right tools (the reference design requires XSDK)
  2. Clone the No-OS GitHub repository (the project is located at ad738x-fmcz )
  3. Follow the instructions provided by software_setup.

No-OS Driver Description

Functions Declarations

Function Description
int32_t ad738x_init(ad738x_dev **device, ad738x_init_param init_param)
Initialize the device.
int32_t ad738x_remove(ad738x_dev *dev)
Free the resources allocated by ad738x_init().
int32_t ad738x_reference_sel(ad738x_dev *dev, ad738x_ref_sel ref_sel)
Enable internal or external reference.
int32_t ad738x_power_down_mode(ad738x_dev *dev, ad738x_pwd_mode pmode)
Device power down.
int32_t ad738x_oversampling_config(ad738x_dev *dev, ad738x_os_mode os_mode, ad738x_os_ratio os_ratio, ad738x_resolution res)
Sets the oversampling mode in the device (os_mode). Sets the oversampling ratio (osr). Sets the size of the conversion result data (res)
int32_t ad738x_reset(ad738x_dev *dev, ad738x_reset_type reset)
Device reset over SPI.
int32_t ad738x_set_conversion_mode(ad738x_dev *dev, ad738x_conv_mode mode)
Select if ADC A and ADC B output on both SDOA and SDOB lines (two wire mode) or only on on the SDOA line.
int32_t ad738x_spi_single_conversion(ad738x_dev *dev, uint16_t *adc_data)
Read conversion result from device.
int32_t ad738x_spi_write_mask(ad738x_dev *dev, uint8_t reg_addr, uint32_t mask, uint16_t data)
SPI write to device using a mask.
int32_t ad738x_spi_reg_write(ad738x_dev *dev, uint8_t reg_addr, uint16_t reg_data)
Write to device.
int32_t ad738x_spi_reg_read(ad738x_dev *dev, uint8_t reg_addr, uint16_t *reg_data)
Read from device.

Types Declarations

typedef enum {
	TWO_WIRE_MODE,
	ONE_WIRE_MODE
} ad738x_conv_mode;
 
typedef enum {
	NORMAL_OS_MODE,
	ROLLING_OS_MODE
} ad738x_os_mode;
 
typedef enum {
	OSR_DISABLED,
	OSR_X2,
	OSR_X4,
	OSR_X8,
	OSR_X16,
	OSR_X32,
} ad738x_os_ratio;
 
typedef enum {
	RES_16_BIT,
	RES_18_BIT
} ad738x_resolution;
 
typedef enum {
	SOFT_RESET,
	HARD_RESET
} ad738x_reset_type;
 
typedef enum {
	NORMAL_PWDM,
	FULL_PWDM
} ad738x_pwd_mode;
 
typedef enum {
	INT_REF,
	EXT_REF
} ad738x_ref_sel;
 
typedef struct {
        /* SPI */
        spi_desc		    *spi_desc;
        /* Device Settings */
        ad738x_conv_mode 	conv_mode;
	ad738x_resolution 	resolution;
} ad738x_dev;
 
typedef struct {
        /* SPI */
        spi_init_param		    spi_init;
        /* Device Settings */
        ad738x_conv_mode 		conv_mode;
        ad738x_ref_sel			ref_sel;
} ad738x_init_param;

HDL Downloads

No-OS Downloads

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.obk20.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'加入时间:清华大学2007年01月25日下午3:33',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.obk20.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);