adc芯片 如ad1674 xdata是根据什么设置的?
如题~应该是要设置xdata或 xbyte的,看了文档,程序示例 还是没搞明白这个器件地址是如何设置的
请指教小弟下,谢谢!
比如下面的程序:
#include <reg51.h>
#include <INTRINS.H>
#include <STDIO.H>
// define P1.0 to check STATUS.
sbit STATUS = P1^0;
unsigned char xdata CTRL_at_ 0x2FFF;//0x2ffff这个值由什么确定捏
unsigned char xdata ADSEL _at_ 0x4FFF;//0x4FFF这个值由什么确定捏
unsigned char hByte;
unsigned char lByte;
void adc_Convert (void)
{ // Start a conversion with A0 and A/$C$ low.
// The convesion takes place on rising CE edge.
CTRL= 0x00;
ADSEL = 0x00;
// Wait until we have completed a conversion .
while(STATUS==1);
// Set R/$C$ with A0 low and read the low byte.
CTRL= 0x02;
hByte = ADSEL;
// Set R/$C$ with A0 high and read the high.
CTRL= 0x03;
lByte = ADSEL;
} 应该是地址线,由你硬件连接的地址线决定。 对滴,根据地址总线 在看看单片机
页:
[1]