05 2019 档案
摘要:1、可以采用取整和取余的方式实现: 2、可以采用移位的方式实现: #include <stdio.h> int main(int argc, char **argv) { int test = 0x2345; printf("%#x\r\n", (test >>8) & 0xff); printf(
阅读全文
摘要:// 添加头文件 #include "stdio.h" #include "stdarg.h" //全局变量 bit TI_busy; unsigned char idata putBuf[100]; //最大数量 /* idata注释: 定义一个字节型的变量,这个变量保存在RAM的idata区.单
阅读全文
posted @ 2019-05-16 09:15
假如蜗牛有梦想
摘要://////////////////////////////////////////////////////////////////////////// #include "USART2.h"#include "usart.h"#include "delay.h" u32 RS485_Baudrat
阅读全文
posted @ 2019-05-13 11:29
假如蜗牛有梦想
摘要:1、基本的RS485电路: 上图是最基本的RS485电路,R/D为低电平时,发送禁止,接收有效,R/D为高电平时,则发送有效,接收截止。上拉电阻R7和下拉电阻R8,用于保证无连接的SP485R芯片处于空闲状态,提供网络失效保护,提高RS485节点与网络的可靠性,R7,R8,R9这三个电阻,需要根据实
阅读全文
posted @ 2019-05-13 10:30
假如蜗牛有梦想
摘要:TIM1 和TIM8 刹车和死区寄存器(TIMx_BDTR): 死区时间控制寄存器位: 首先,理解这些计算位的含意,如下: DT 为需要计算的死区时间; TDTS为系统时钟所产生的周期时间; Tdtg为步进计算值,Tdtg = TDTS * 倍数; 接着,以定时器设定为72MHz进行计算举例: TD
阅读全文
摘要:/******************************************************** * SClist.h头文件 /********************************************************/ #ifndef __SCLIST_H_
阅读全文
摘要:平台: freescale CodeWarrior MCU:MC9S12G128(汽车级芯片) #include "Ds18b20.h" /************************************************************ * DS18B20 status in
阅读全文
摘要:结构体初始化: /************************************************************ * 全局变量定义 ************************************************************/ /********
阅读全文

浙公网安备 33010602011771号