找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5237|回复: 3
打印 上一主题 下一主题
收起左侧

24位AD转换芯片

[复制链接]
跳转到指定楼层
楼主
ID:126173 发表于 2016-6-12 00:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
那位高人有24位AD芯片,如ADI家的AD7710  AD7794  。LTC家的LTC2400 LTC2440  或是TI家的,等等随便什么公司的,24位以上,高精度AD芯片,汇编语言程序,给在下参考。
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:126314 发表于 2016-6-12 09:55 | 只看该作者
帮你顶一下    同求
回复

使用道具 举报

板凳
ID:126173 发表于 2016-6-12 17:14 | 只看该作者
51系读AD7710
Table VII. 8XC51 Code for Reading from the AD7710
MOV SCON,#00010001B;        Configure 8051 for MODE 0                        Operation
MOV IE,#00010000B;         Disable All Interrupts
SETB 90H;        Set P1.0, Used as RFS
SETB 91H;        Set P1.1, Used as TFS
SETB 93H;         Set P1.3, Used as A0
MOV R1,#003H;        Sets Number of Bytes to Be Read in
        A Read Operation
MOV R0,#030H;        Start Address for Where Bytes Will
        Be Loaded
MOV R6,#004H;         Use P1.2 as DRDY
WAIT:
NOP;
MOV A,P1;         Read Port 1
ANL A,R6;         Mask Out All Bits Except DRDY
JZ READ;        If Zero Read
SJMP WAIT;         Otherwise Keep Polling
READ:
CLR 90H;         Bring RFS Low
CLR 98H;        Clear Receive Flag
POLL:
JB 98H, READ1        Tests Receive Interrupt Flag
SJMP POLL
READ 1:
MOV A,SBUF;        Read Buffer
RLC A;         Rearrange Data
MOV B.0,C;        Reverse Order of Bits
  RLC A; MOV B.1,C; RLC A; MOV B.2,C;
  RLC A; MOV B.3,C; RLC A; MOV B.4,C;
  RLC A; MOV B.5,C; RLC A; MOV B.6,C;
  RLC A; MOV B.7,C;
  MOV A,B;
  MOV @R0,A;        Write Data to Memory
  INC R0;        Increment Memory Location
  DEC R1        Decrement Byte Counter
  MOV A,R1
  JZ END        Jump if Zero
  JMP WAIT        Fetch Next Byte
END:
SETB 90H        Bring RFS High
FIN:
SJMP FIN
回复

使用道具 举报

地板
ID:126173 发表于 2016-6-12 17:14 | 只看该作者
51系写AD7710
Table VIII. 8XC51 Code for Writing to the AD7710
MOV SCON,#00000000B;        Configure 8051 for MODE 0
        Operation & Enable Serial Reception
MOV IE,#10010000B;        Enable Transmit Interrupt
MOV IP,#00010000B;        Prioritize the Transmit Interrupt
SETB 91H;        Bring TFS High
SETB 90H;        Bring TFS High
MOV R1,#003H;        Sets Number of Bytes to Be Written
        in a Write Operation
MOV R0,#030H;        Start Address in RAM for Bytes
MOV A,#00H;        Clear Accumulator
MOV SBUF,A;        Initialize the Serial Port
WAIT:
JMP WAIT;        Wait for Interrupt
INT ROUTINE:
NOP;        Interrupt Subroutine
MOV A,R1;         Load R1 to Accumulator
JZ FIN;        If Zero Jump to FIN
DEC R1;        Decrement R1 Byte Counter
MOV A,@R;        Move Byte into the Accumulator
INC R0;         Increment Address
RLC A;        Rearrange Data—From LSB First
        to MSB First
MOV B.0,C; RLC A; MOV B.1,C; RLC A;
MOV B.2,C; RLC A; MOV B.3,C; RLC A;
MOV B.4,C; RLC A; MOV B.5,C; RLC A;
MOV B.6,C; RLC A: MOV B.7,C; MOV A,B;
CLR 93H;        Bring A0 Low
CLR 91H;        Bring TFS Low
MOV SBUF,A;        Write to Serial Port
RETI;        Return from Subroutine
FIN:
SETB 91H;        Set TFS High
SETB 93H;        Set A0 High
RETI;        Return from Interrupt Subroutine
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表