虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

CHar

  • const CHar *与CHar * const的区别

    const CHar *与CHar * const的区别

    标签: const CHar

    上传时间: 2017-09-16

    上传用户:shus521

  • Ascii码的88点阵数据.rar

    Ascii码的8*8点阵数据,竖着排的。 code unsigned CHar asc5x8dot[96][5]={//ASC码0x20~0x7f

    标签: Ascii 点阵 数据

    上传时间: 2013-04-24

    上传用户:HGH77P99

  • 3des加密算法及调用示例.rar

    调用方法(加密》解密》加密): unsigned CHar key1[] = "12345678"; unsigned CHar key2[] = "abcdefgh"; unsigned CHar key3[] = "~!@#$%^&"; //如果只需要两组密钥,则本组密钥可以和密钥1一样。 unsigned CHar en_data[] = "龙的子孙"; unsigned CHar en_out_put[8]; //3DES 加密 des(en_data, key1, en_out_put, DES_ENCRYPT); des(en_out_put, key2, en_data, DES_DECRYPT); des(en_data, key3, en_out_put, DES_ENCRYPT);

    标签: 3des 加密算法

    上传时间: 2013-07-10

    上传用户:Poppy

  • TLC2543 中文资料

    TLC2543是TI公司的12位串行模数转换器,使用开关电容逐次逼近技术完成A/D转换过程。由于是串行输入结构,能够节省51系列单片机I/O资源;且价格适中,分辨率较高,因此在仪器仪表中有较为广泛的应用。 TLC2543的特点 (1)12位分辩率A/D转换器; (2)在工作温度范围内10μs转换时间; (3)11个模拟输入通道; (4)3路内置自测试方式; (5)采样率为66kbps; (6)线性误差±1LSBmax; (7)有转换结束输出EOC; (8)具有单、双极性输出; (9)可编程的MSB或LSB前导; (10)可编程输出数据长度。 TLC2543的引脚排列及说明    TLC2543有两种封装形式:DB、DW或N封装以及FN封装,这两种封装的引脚排列如图1,引脚说明见表1 TLC2543电路图和程序欣赏 #include<reg52.h> #include<intrins.h> #define uCHar unsigned CHar #define uint unsigned int sbit clock=P1^0; sbit d_in=P1^1; sbit d_out=P1^2; sbit _cs=P1^3; uCHar a1,b1,c1,d1; float sum,sum1; double  sum_final1; double  sum_final; uCHar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uCHar wei[]={0xf7,0xfb,0xfd,0xfe};  void delay(unsigned CHar b)   //50us {           unsigned CHar a;           for(;b>0;b--)                     for(a=22;a>0;a--); }  void display(uCHar a,uCHar b,uCHar c,uCHar d) {    P0=duan[a]|0x80;    P2=wei[0];    delay(5);    P2=0xff;    P0=duan[b];    P2=wei[1];    delay(5);   P2=0xff;   P0=duan[c];   P2=wei[2];   delay(5);   P2=0xff;   P0=duan[d];   P2=wei[3];   delay(5);   P2=0xff;   } uint read(uCHar port) {   uCHar  i,al=0,ah=0;   unsigned long ad;   clock=0;   _cs=0;   port<<=4;   for(i=0;i<4;i++)  {    d_in=port&0x80;    clock=1;    clock=0;    port<<=1;  }   d_in=0;   for(i=0;i<8;i++)  {    clock=1;    clock=0;  }   _cs=1;   delay(5);   _cs=0;   for(i=0;i<4;i++)  {    clock=1;    ah<<=1;    if(d_out)ah|=0x01;    clock=0; }   for(i=0;i<8;i++)  {    clock=1;    al<<=1;    if(d_out) al|=0x01;    clock=0;  }   _cs=1;   ad=(uint)ah;   ad<<=8;   ad|=al;   return(ad); }  void main()  {   uCHar j;   sum=0;sum1=0;   sum_final=0;   sum_final1=0;    while(1)  {              for(j=0;j<128;j++)          {             sum1+=read(1);             display(a1,b1,c1,d1);           }            sum=sum1/128;            sum1=0;            sum_final1=(sum/4095)*5;            sum_final=sum_final1*1000;            a1=(int)sum_final/1000;            b1=(int)sum_final%1000/100;            c1=(int)sum_final%1000%100/10;            d1=(int)sum_final%10;            display(a1,b1,c1,d1);           }         } 

    标签: 2543 TLC

    上传时间: 2013-11-19

    上传用户:shen1230

  • MEGA16制作的电子时钟(附仿真图+源代码)

    #include <iom16v.h> #include <macros.h> #define uCHar unsigned CHar #define uint unsigned int uCHar num,miao,fen,shi,miaoge,miaoshi,fenge,fenshi,shig

    标签: MEGA 16 电子时钟 仿真图

    上传时间: 2013-10-14

    上传用户:sc965382896

  • AVR单片机数码管秒表显示

    #include<iom16v.h> #include<macros.h> #define uint unsigned int #define uCHar unsigned CHar uint a,b,c,d=0; void delay(c) { for for(a=0;a<c;a++) for(b=0;b<12;b++); }; uCHar tab[]={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,

    标签: AVR 单片机 数码管

    上传时间: 2013-10-21

    上传用户:13788529953

  • c51流水灯仿真与程序

    对应程序: #include<reg52.h> #define uint unsigned int #define uCHar unsigned CHar uCHar code tab[]={ 0x81, 0x42, 0x24, 0x18, }; void delay(uint z) { uint i,j; for(i=z;i>0;i--) for(j=120;j>0;j--); } void init() { P0=0x00; }

    标签: c51 流水灯 仿真 程序

    上传时间: 2014-01-17

    上传用户:ruan2570406

  • Keil C51库函数参考

      第五章 Keil C51库函数参考   C51强大功能及其高效率的重要体现之一在于其丰富的可直接调用的库函数,多使用库函数使程序代码简单,结构清晰,易于调试和维护,下面介绍C51的库函数系统。   1. 第一节 本征库函数(intrinsic routines)和非本征证库函数   C51提供的本征函数是指编译时直接将固定的代码插入当前行,而不是用ACALL和LCALL语句来实现,这样就大大提供了函数访问的效率,而非本征函数则必须由ACALL及LCALL调用。   C51的本征库函数只有9个,数目虽少,但都非常有用,列如下:   _crol_,_cror_:将CHar型变量循环向左(右)移动指定位数后返回   _iror_,_irol_:将int型变量循环向左(右)移动指定位数后返回   _lrol_,_lror_:将long型变量循环向左(右)移动指定位数后返回   _nop_: 相当于插入NOP   _testbit_: 相当于JBC bitvar测试该位变量并跳转同时清除。   _chkfloat_: 测试并返回源点数状态。   使用时,必须包含#inclucle 一行。   如不说明,下面谈到的库函数均指非本征库函数  

    标签: Keil C51 库函数

    上传时间: 2013-10-19

    上传用户:1184599859

  • 单片机几种软件滤波程序示例

    假定从8位AD中读取数据(如果是更高位的AD可定义数据类型为int),子程序为get_ad(); 1、限幅滤波法(又称程序判断滤波法)     A、方法:         根据经验判断,确定两次采样允许的最大偏差值(设为A)         每次检测到新值时判断:         如果本次值与上次值之差<=A,则本次值有效         如果本次值与上次值之差>A,则本次值无效,放弃本次值,用上次值代替本次值     B、优点:         能有效克服因偶然因素引起的脉冲干扰     C、缺点         无法抑制那种周期性的干扰         平滑度差 /*  A值可根据实际情况调整     value为有效值,new_value为当前采样值      滤波程序返回有效的实际值  */ #define A 10 CHar value; CHar filter() {    CHar  new_value;    new_value = get_ad();    if ( ( new_value - value > A ) || ( value - new_value > A )       return value;    return new_value;          } 2、中位值滤波法     A、方法:         连续采样N次(N取奇数)         把N次采样值按大小排列         取中间值为本次有效值     B、优点:         能有效克服因偶然因素引起的波动干扰         对温度、液位的变化缓慢的被测参数有良好的滤波效果     C、缺点:         对流量、速度等快速变化的参数不宜 /*  N值可根据实际情况调整     排序采用冒泡法*/

    标签: 单片机 软件滤波 程序

    上传时间: 2014-12-26

    上传用户:nanshan

  • 51单片机实现的RS485通讯程序

      #ifndef __485_C__   #define __485_C__   #include   #include   #define unsigned CHar uCHar   #define unsigned int uint   /* 通信命令 */   #define __ACTIVE_ 0x01 // 主机询问从机是否存在   #define __GETDATA_ 0x02 // 主机发送读设备请求   #define __OK_ 0x03 // 从机应答   #define __STATUS_ 0x04 // 从机发送设备状态信息   #define __MAXSIZE 0x08 // 缓冲区长度   #define __ERRLEN 12 // 任何通信帧长度超过12则表示出错   uCHar dbuf[__MAXSIZE]; // 该缓冲区用于保存设备状态信息   uCHar dev; // 该字节用于保存本机设备号   sbit M_DE = P1^0; // 驱动器使能,1有效   sbit M_RE = P1^1; // 接收器使能,0有效

    标签: 485 RS 51单片机 通讯程序

    上传时间: 2014-12-26

    上传用户:604759954