欢迎访问ic37.com |
会员登录 免费注册
发布采购

TM7705 参数 Datasheet PDF下载

TM7705图片预览
型号: TM7705
PDF下载: 下载PDF文件 查看货源
内容描述: [16bit模数转换器]
分类和应用: 转换器模数转换器
文件页数/大小: 42 页 / 1157 K
品牌: ETC [ ETC ]
 浏览型号TM7705的Datasheet PDF文件第33页浏览型号TM7705的Datasheet PDF文件第34页浏览型号TM7705的Datasheet PDF文件第35页浏览型号TM7705的Datasheet PDF文件第36页浏览型号TM7705的Datasheet PDF文件第38页浏览型号TM7705的Datasheet PDF文件第39页浏览型号TM7705的Datasheet PDF文件第40页浏览型号TM7705的Datasheet PDF文件第41页  
16 bit 模数转换器  
TM7705  
{
/* the only pin that is programmed herefrom the 68HC11 is the /CS  
and this is why the PC2 bit of PORTC is madeas  
an output */  
char a;  
DDRC = 0x04; /* PC2 is an output the restof the port bits are inputs */  
PORTC | = 0x04; /* make the /CS line high */  
Writetoreg(0x20); /* Active Channel is Ain1(+)/Ain1(-),next operation aswrite to the  
clock register*/  
Writetoreg(0x0C); /* master clock enabled,4.9512MHz Clock, set output rate  
to 50Hz*/  
Writetoreg(0x10); /* Active Channel is Ain1(+)/Ain1(-),next operation aswrite to the  
setup register*/  
Writetoreg(0x40); /* gain = 1, bipolar mode, buffer off, clear FSYNC and perform a  
Self Calibration*/  
while(PORTC & 0x10); /* wait for /DRDY to go low */  
for(a=0;a<NUM_SAMPLES;a++);  
{
Writetoreg(0x38); /*set the next operation for 16 bit readfrom the data  
register*/  
Read(NUM_SAMPES,2);  
}
}
Writetoreg(int byteword);  
{
int q;  
SPCR = 0x3f;  
SPCR = 0X7f; /* this setsthe WiredOR mode(DWOM=1), Master mode(MSTR=1),  
SCK idles high(CPOL=1),  
/SS can be low always(CPHA=1), lowest clock  
speed(slowestspeedwhich is masterclock /32 */  
DDRD= 0x18; /* SCK, MOSI outputs */  
q = SPSR;  
q = SPDR; /* the readof the stausregisterand of the data register is neededto  
clearthe interrupt which tells the userthat the data transfer is complete */  
PORTC &= 0xfb; /* /CS is low */  
SPDR = byteword; /* put the byte into data register*/  
while(!(SPSR & 0x80));  
/* wait for /DRDY to go low */  
PORTC |=  
0x4; /* /CS high */  
}
Read(int amount, int reglength)  
{
int q;  
SPCR = 0x3f;  
SPCR = 0x7f; /* clearthe interupt */  
©Titan Micro Electronics  
www.titanmec.com  
-37-  
 复制成功!