资源简介
AD7745/1D7746 c程序 已经调试成功,放心使用
代码片段和文件信息
// mcu stc89c52
// fsoc=11.0592M
///////////////////////////
#include
#include
#define uchar unsigned char
#define uint unsigned int
sfr P1M1=0X91;
sfr P1M0=0X90;
sbit SCL=P1^0;
sbit SDA=P1^1;
uchar Ans=0;
uchar Cap_Range=0;
//const uchar OffSet_Cap[2]={0xD20xF0};
const uchar OffSet_Cap[2]={0xD20xF0};
uchar i_receiveTC35_RECE_MAX=10i_TC35_RECE=0;//COM_Flg=1;
uchar TC35_RECE[10];
//////////////////////////////
void Delay_1(int i)
{
while(i--);
}
/////////////////////
/*void delay(unsigned char ms)
{ // 延时子程序
unsigned char i;
while(ms--)
{
for(i = 0; i< 250; i++)
{
_nop_();
_nop_();
_nop_();
_nop_();
}
}
}
/***********************************************************
函数名称:Ini_UART
函数功能:串口初始化设置 入口参数:无 出口参数:无
***********************************************************/
void uart_int(void)
{
// AUXR = 0x40; //timer0 12T ang timer1 1T
SCON = 0x50; //UART方式1:8位UART; REN=1:允许接收
PCON = 0x00; //SMOD=0:波特率不加倍
TMOD = 0x20; //T1方式2用于UART波特率
TH1 = 0xFD;
TL1 = 0xFD; //UART波特率设置:9600
TR1 = 1;
EA=1;
ES=1;
}
/***********************************************************
函数名称 :delay
函数功能 :延时 入口参数:z 出口参数:无
***********************************************************/
/*void delay_SMS(uint z)
{
uint xy;
for(x=z;x>0;x--)
for(y=55;y>0;y--);
}
/***********************************************************
函数名称 :send
函数功能 :入口参数:tab 出口参数 :无
***********************************************************/
void send(uchar *tab)
{
while((*tab)!= ‘\0‘)
{
SBUF =*tab;
while(TI ==0);
TI = 0;
tab++;
}
}
/***********************************************************
函数名称 :receive
函数功能 :入口参数:无 出口参数 :无
***********************************************************/
void serial() interrupt 4 using 3
{
if (RI)
{
RI = 0 ;
i_receive=SBUF;
if(i_TC35_RECE {
TC35_RECE[i_TC35_RECE++]=i_receive;
}
}
}
/*******************************************************************************
**函数名称:void IIC_Stop()
**函数功能:结束IIC通信
//Precondition: after reading or sending the data the SCL is in low state
********************************************************************************/
void IIC_Start()
{
SDA=1;SCL=1;
_nop_();
Delay_1(5) ;
SDA=0; //SDA low first
_nop_();
Delay_1(5) ;
SCL=0; //set SCL low
_nop_();
Delay_1(5) ;
}
/*******************************************************************************
**函数名称:void IIC_Stop()
**函数功能:结束IIC通信
//Precondition: after reading or sending the data the SCL is in low state
****************
相关资源
- pcbtemp电流计算软件
- I2C读写AT24C02 基于STM32F103 cube116540
- Scratch源码
- Microsoft Forms 2.0107770
- 实验三 消息中间件应用开发:Active
- WCE注入工具
- ModelGoon-4.4.1-site.zip
- AsyncTask文件控制暂停和继续,在状态
- Visio大全模具(含Cisco、IBM等常用拓扑
- 信号奇异点Lipschitz指数计算
- 基于STM32RCT6的步进电机驱动程序
- 酒店管理系统基于Qt Creator5)
- 用友NC开发API字典
- Navicat Premium 15汉化包.zip55438
- 登录注册界面.zip48872
- 条码字体barcode128
- Rational Rose Common破解文件
- res10_300x300_ssd_iter_140000.caffemodel与dep
- scratch 第1课 翻跟斗的小猫(入门)
- stm32f407上的两个can发送和接收例程
- Scrach 欢乐狙击手.sb2
- 04741计算机网络原理知识点整理.docx(
- Wolfram Mathematica 矩阵初等变换函数(
- pscad近海风电模型 Fortran语言
- 程序员专用字体YaHei.Consolas.1.11b42517
- scratch3.0 源程序(说相声)
- AutoCAD永久去教育版破解补丁
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
评论
共有 条评论