下载此文档

stc89c52很多有用程序(STC89C52 a lot of useful programs).doc


文档分类:资格/认证考试 | 页数:约51页 举报非法文档有奖
1/51
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/51 下载此文档
文档列表 文档介绍
stc89c52很多有用程序(STC89C52 a lot of useful programs)
Function: AD0832 driver read analog voltage value, convert AD
After the value of the use of serial output. CHO of ADC0832
(channel 0) is the voltage change detection of photosensitive resistance.
At the same time, increase the digital display AD conversion value function.
Serial output, serial debugging is a microcontroller program
The monly used and most important tool. Need to be used before use
The development board crystal oscillator frequency is , such as
No, please replace the crystal, or self timer calculation
Numerical value.
Time: 2011-8-23
******************************************/
/ / header file
#include <>
#include <>
/ / macro definition
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
/ / pin definition
Sbit ADC0832_CLK = P3^5;
Sbit ADC0832_DODI =P2^7;
Sbit ADC0832_CS = P3^4;
/*****************************************************/
(according to the definition of pin / / hardware changes)
Sbit BCD6 = P1^5;
Sbit BCD5 = P1^4;
Sbit BCD4 = P1^3;
Sbit BCD3 = P1^2;
Sbit BCD2 = P1^1;
Sbit BCD1 = P1^0;
#define BCD_PORT P0
/**********************************************************************************************/
Code uchar BCD[]={0x3f, 0x06,0x5b, 0x4f, 0x66,0x6d, 0x7d, 0x07,0x7f, 0x6f, 0xbf, 0x86,0xdb, 0xcf, 0xe6,0xed, 0xfd, 0x87,0xff, 0xef, 0x40};
/ / definition digital display array as a constant, common cathode
1. / / /*0,1,2,3,4,5,6,7,8,9,0., 2., 3., 4., 5., 6., 7., 8., 9., - /
/ / function declaration
/******************************************/
/ / delay functions when,
The parameters of d_time control / / delay time
Effect of light extinction and / /, must persist for some time, the human eye can see
Void delay (unsigned int time);
/******************************************/
/ / delay functions
The range of parameters of 0-65536 / /
Void delay (unsigned int time) / time size parameters
{/ / det

stc89c52很多有用程序(STC89C52 a lot of useful programs) 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数51
  • 收藏数0 收藏
  • 顶次数0
  • 上传人rjmy2261
  • 文件大小31 KB
  • 时间2017-11-23