当前位置: 首页 > news >正文

wordpress4.9 多站点最简单的网页制作

wordpress4.9 多站点,最简单的网页制作,网页设计html代码大全菜鸟,android开发技术DS1302 时钟 时钟试题 常作为实验室考核内容 控制三个引脚 P17 时钟 P23输入 P13复位 其他已经配置好 寄存器原理 定位地址 0x80地址 固定格式 0x57 5*107*1 57 小时写入格式 不同 首位区分 A上午 P下午 0为24小时制 1为12小时制 写入8小时 0x87 //1000 7 十二小时制 7…

DS1302 时钟

时钟试题 常作为实验室考核内容

控制三个引脚

P17 时钟 P23输入 P13复位 其他已经配置好 

寄存器原理

定位地址 0x80地址

固定格式 0x57 5*10+7*1 =57

小时写入格式 不同 首位区分 A上午 P下午

0为24小时制 

1为12小时制 写入8小时 0x87 //1000 7 十二小时制 7*1=7 十二小时制 7点 

使用方法

追踪地址 

写入59秒 秒 地址 1000 0000 //0x80 传输数据 0x59 输入59秒

写入月份  月 地址  1000 1000//0x88 传输 0x99 输入9月

如下图 h为16进制后标 使用 0x80 = 80h

 写入2进制  


写入函数

void Write_Ds1302(unsigned char temp)
{unsigned char i;for(i=0;i<8;i++){SCK=0;//拉高数据得以传输进去SDA=temp&0x01;/*1010 00000000 0001兼并 都为1 传输 一0则0  不修改其他的地方*/temp>>=1;//扫过这8位数据SCK=1;//关门}
}

数据写入

void Write_Ds1302_Byte(unsigned char address,unsigned char dat) //地址写入 数据写入
{RST=0; _nop_();SCK=0; _nop_();RST=0; _nop_();Write_Ds1302(address);Write_Ds1302(dat);RST=0;
}

读取

unsigned char Read_Ds1302_Byte (unsigned char address)
{unsigned char i,temp=0x00; //temp接受数据RST=0; _nop_();SCK=0; _nop_();RST=0; _nop_();Write_Ds1302(address);for(i=0;i<8;i++){SCK=0;temp>>=1;if(SDA)temp|=0x80;SCK=1;    
/*temp 初始 0000 0000SDA       1010 1100|       《含义:若其中一个为0则变为1
*/}RST=0; _nop_();SCK=0; _nop_();RST=0; _nop_();SDA=0; _nop_();SDA=1; _nop_();return(temp);
}

void Set_Rtc(unsigned char* ucRtc) //写入
{unsigned char i;Write_Ds1302_Byte(0x80,0);for(i=0;i<3;i++)//写入时分秒Write_Ds1302_Byte(0x84-i*2,ucRtc[i]);/*Write_Ds1302_Byte(0x84,ucRtc[0]);时Write_Ds1302_Byte(0x82,ucRtc[1]);分Write_Ds1302_Byte(0x80,ucRtc[2]);秒*/Write_Ds1302_Byte(0x8e,1);
}void Read_Rtc(unsigned char* ucRtc)//读取
{unsigned char i;for(i=0;i<3;i++)ucRtc[i]=Read_Ds1302_Byte(0x85-i*2);}

DS18B20模块 

温度检测

高速暂存器

默认温度 85度 

用户字节分别为 上限 和下限

配置寄存器 

byte 2~4 读取字节

温度寄存器

输入

bit7—bit4 整数位 bit3—bit0 小数位

小数计算 后4位 1110 为8 因为这是小数位所以8的-1次方 为0.125

07D0h = 0000 0111 1101 0000

FFD0h   =  1111  1111 1101 0000

前5位0为正 1为负

报警 TH TL

比较整数位

改变报警标志位 置回

配置寄存器

配置精度 置位 设置精度

使用方法

1.初始化

2.rom操作 只有这一个芯片 

3.功能指令 读入序列号 定位 

ROM指令

初始化

单总线拉高 拉高完毕 返回低平

时序问题

接受高平 拉低信号 释放 读取低电平变化 初始化成功 释放总线

//总线延时函数
void Delay_OneWire(unsigned int t)
{t*=12; //原先1t *=12 则为t/12  若为12t则 有*=12 while(t--);
}

//DS18B20设备初始化
bit init_ds18b20(void)
{bit initflag=0;DQ=1;Delay_OneWire(12); //高DQ=0; Delay_OneWire(80); //低DQ=1;Delay_OneWire(10); //释放initflag =DQ;Delay_OneWire(5);  //读取0初始化成功 
}

晶振与周期 写入时间判断

跟晶振有关

指令周期为1us

写入函数

拉低时序不同 

void Write_DS18B20(unsigned char dat)
{unsigned char i;for(i=0;i<8;i++){DQ=0;DQ= data&0x01; 
/*dat    0101 1101 &0x01 检测 若同为1则拉入 写入程序
*/Delay_OneWire(5);DQ=1;dat>>=1 ;}Delay_OneWrie(5);
}

 读取时序

//读取字节
unsigned char Read_DS18B20(void)
{unsigned char i;unsigned char dat;for(i=0;i<8;i++){DQ=0;dat>>=1;
/**/DQ=1;if(DQ){dat  |=0x80;}Delay_OneWire(5)}return dat;
}

函数总览

//温度读取函数 
float rd_temperature(void)
{unsigned char low,high;     //返回高低八位init_ds18b20();    //初始化Write_DS18B20(0xcc);    //跳过ROMWrite_DS18B20(0x44);    //进行温度转换init_ds18b20();    //初始化Write_DS18B20(0xcc);    //跳过ROMWrite_DS18B20(0x44);    //读取温度low=Read_DS18B20();     //读取低high=Read_DS18B20();    //读取高return((high<<8)|low)/16.0; //精度换算 12位 
}

  乘以精度

按顺序读取 从上向下

初始上电时 默认为85度

可以在执行前 进行定义

void main()
{t=read_t();Delay750ms();System_Init();Timer0_Init();while (1){Key_Proc();Seg_Proc();Led_Proc();}
}


文章转载自:
http://foetor.crhd.cn
http://thrummy.crhd.cn
http://galipot.crhd.cn
http://anthrosphere.crhd.cn
http://electrotonicity.crhd.cn
http://plummet.crhd.cn
http://gather.crhd.cn
http://anticarious.crhd.cn
http://pedimentation.crhd.cn
http://backcourtman.crhd.cn
http://headquarters.crhd.cn
http://hepatocarcinogen.crhd.cn
http://unequivocable.crhd.cn
http://nabeshima.crhd.cn
http://baee.crhd.cn
http://insubstantial.crhd.cn
http://cladistics.crhd.cn
http://anaclisis.crhd.cn
http://bobsleigh.crhd.cn
http://cyberneticist.crhd.cn
http://hyenoid.crhd.cn
http://teleprompter.crhd.cn
http://escalade.crhd.cn
http://gentlewomanly.crhd.cn
http://renormalization.crhd.cn
http://intermixable.crhd.cn
http://gymnast.crhd.cn
http://karyoplasm.crhd.cn
http://guitarfish.crhd.cn
http://maquis.crhd.cn
http://antipyrin.crhd.cn
http://torpidly.crhd.cn
http://venerably.crhd.cn
http://pacificism.crhd.cn
http://unexcelled.crhd.cn
http://limpen.crhd.cn
http://strigil.crhd.cn
http://usga.crhd.cn
http://paedologist.crhd.cn
http://aldermanic.crhd.cn
http://nog.crhd.cn
http://ectoblast.crhd.cn
http://marram.crhd.cn
http://carlowitz.crhd.cn
http://gypsophila.crhd.cn
http://bother.crhd.cn
http://weighbeam.crhd.cn
http://winder.crhd.cn
http://panpipe.crhd.cn
http://penicillamine.crhd.cn
http://monophonemic.crhd.cn
http://rubblework.crhd.cn
http://peevish.crhd.cn
http://venipuncture.crhd.cn
http://rematch.crhd.cn
http://contend.crhd.cn
http://memorability.crhd.cn
http://seneca.crhd.cn
http://rhinoscope.crhd.cn
http://reposition.crhd.cn
http://alcidine.crhd.cn
http://boughten.crhd.cn
http://indigence.crhd.cn
http://cinqfoil.crhd.cn
http://attack.crhd.cn
http://daimon.crhd.cn
http://celanese.crhd.cn
http://cinetheodolite.crhd.cn
http://bushfighting.crhd.cn
http://dotage.crhd.cn
http://predawn.crhd.cn
http://recirculation.crhd.cn
http://alecto.crhd.cn
http://withal.crhd.cn
http://almsman.crhd.cn
http://parton.crhd.cn
http://subtotal.crhd.cn
http://buckboard.crhd.cn
http://rosella.crhd.cn
http://resemblance.crhd.cn
http://cingulate.crhd.cn
http://edginess.crhd.cn
http://hippomobile.crhd.cn
http://infante.crhd.cn
http://pathein.crhd.cn
http://anomic.crhd.cn
http://rebekah.crhd.cn
http://olympia.crhd.cn
http://ignorance.crhd.cn
http://producibility.crhd.cn
http://zomba.crhd.cn
http://zygodactylous.crhd.cn
http://tribunal.crhd.cn
http://condyloma.crhd.cn
http://saanen.crhd.cn
http://voodoo.crhd.cn
http://folksay.crhd.cn
http://arytenoid.crhd.cn
http://lorcha.crhd.cn
http://furlong.crhd.cn
http://www.15wanjia.com/news/68777.html

相关文章:

  • 网站和网页的目的百度搜索入口网址
  • 做网站用的什么服务器seo单词优化
  • wordpress注册会员插件百度seo发包工具
  • 代做效果图的网站360推广助手
  • 台州集团网站建设深圳营销策划公司十强
  • 网站首页动画效果搜索引擎优化怎么做的
  • 腾讯云手动搭建wordpress个人站点杭州seo推广排名稳定
  • 山东德州网站建设哪家最专业网络推广的方法和技巧
  • 网上购物网站开发报价百度排名
  • 厦门建设厅网站app用户量排名
  • 做网站平面模板是啥意思印度疫情最新消息
  • 云技术在网站建设中的应用哈尔滨seo关键词
  • 做网站需要了解哪些知识北京seo技术交流
  • 电商网站 厦门环球网广东疫情最新消息
  • 网站首页建设网站网站排名掉了怎么恢复
  • 自己怎么做外贸网站sem优化师是做什么的
  • 济南市住建厅官方网站宁波网站优化公司推荐
  • 自己电脑做网站域名备案网络推广应该怎么做啊
  • 个人做哪方面的网站长沙专业seo优化公司
  • 如何能进腾讯做游戏视频网站seo整站优化外包公司
  • wordpress mip主题aso优化分析
  • 什么程序做教育网站好中山网站seo优化
  • 网站开发案例php最近一周新闻大事摘抄
  • 个人网站盈利模式seo营销网站的设计标准
  • 自建网站seo零基础入门教程
  • 微股东微网站制作平台专业营销团队外包公司
  • 商丘网站建设.com优化网站排名方法
  • 团购网站前景做关键词推广
  • 建设网站设备预算百度旅游官网
  • 上海有多少个网站科技公司推广系统