📄 call0832.c
字号:
/* 这是调用TLC0832的汇编程序(TLC0832B.ASM)的C51程序, */
/* 文件名CALL0832.C */
/* 功能:本程序主要是读出输入通道CH0,CH1的模数转换值,转换值放在 */
/* 变量temp1和temp2中。TLC083芯片既可单端输入,又可差分输入*/
/* 这里采用单端输入。 */
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
#define lint unsigned long int
void timedelay(uint timess);
void delay1(uint x);
void pick(void);
extern uchar chai;
extern uchar a_func(uchar);
uchar idata temp1,temp2 ;
void timedelay(uint timess)
{
uint tj;
for (tj=timess;tj>0;tj--){;}
}
void delay1(uint x)
{
uchar tw;
while (x-->0){
for (tw=0;tw<125;tw++){;}
}
}
void pick()
{
chai=a_func(0x03); /* input 1 road */
temp1=chai;
chai=a_func(0x07); /* input 2 road */
temp2=chai;
}
void main()
{
SP=0xcf;
timedelay(10000);
delay1(1000);
EA=0;
pick();
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -