最近在做一个4-20mA输出的项目,遇到一些问题,但是还好顺利解决,使用STM32F103C8T6和AD5420,下面是电路图:
AD5420电路参考datasheet和CN0270,www.analog.com/CN0270.
通讯使用的是官方示例程序移植,官方为4-20mA,我这项目为了有其他模式所以改为0-24mA输出。
程序如下:
头文件如下:
#ifndef __AD5420_IO_H
#define __AD5420_IO_H
//#include "include.h"
//#include "sys.h"
/*----------------------------------------------------------------------
File Name : AD5420_IO.h
Author : Neil Zhao - CAST
Version : V1.0
Date : 1/8/2009
Description : AD5420 Driver Declaration
The AD5410/AD5420 are low-cost, precision, fully integrated
12/16-bit converter offering a programmable current source
output designed to meet the requirements of industrial process
control applications.
China Applications Support Team.
china.support@analog.com
----------------------------------------------------------------------
The present firmware which is for guidance only aims at providing
customers with coding information regarding their products in order
for them to save time. As a result, Analog Devices shall not be
held liable for any direct, indirect or consequential damages with
respect to any claims arising from the content of such firmware and/or
the use mad