2008-05-28 21:11:58
和大家分享分享,有不妥之处望多赐教:
键盘设计采用AD扫描,现将AD扫描原理分析如下,电路如图5-8:
当没有按键按下时:
...............(1)
当KEY1有按键时:
............(2)
当KEY2有按键时:
............(3)
当KEY3有按键时:
............(4)
当KEY4有按键时:
.......... |
2008-02-24 11:13:49
本文来自:http://www.21ic.com/news/html/97/show24106.htm
本文原作者结合自身经历,总结以下六种方法,可以帮助我们成为一名更好的开发者。
1. 交谈
尽可能多地跟其他软件开发者交谈;培养个人关系;跟意见与你相左的人交流; |
2008-01-09 12:10:28
//使用请声明代码来源
#include <reg52.h>
#include <PORTSET.h>
#include <math.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
#define x1 &n |
2008-01-08 16:31:04
//使用请申明代码来源
//程序不包含时间校准部分 晶振为16MHz
#include <reg52.h>
#define uint unsigned int
#define uchar unsigned char
#define x1 0x80
#define x2 0x88
#de |
2008-01-05 12:04:19
//初始化串口:串口工作方式1,允许接受REN=1,波特率=1200
void initialize_UART()
{
P1=0xFF;
TMOD=0x20;
//下面已修改为适合16MHz的f7,12MHz改成e6,11.0592改成E8
TH1=0xf7;//0xe6;
TL1 |
2008-01-04 10:14:40
C 编译器常见警告与错误信息的解决方法
声明:本文来自http://youjjyycg.blog.163.com/blog/static/268741952007310101429383/
1. Warning 280:’i’:unreferenced local variable
说明局部变量i 在函数中未作任何的存取操作。
|
2008-01-02 17:30:44
//使用请声明代码来源
/*****************************************************************************
函数:ADCInitial(unsigned char chanal,unsigned char speed)
出口 |
2007-12-28 12:29:31
//使用时请在代码中声明代码来源
#include <reg52.h>
#include <math.h>
#include <intrins.h>
#define uint unsigned int
#define uchar unsigned char
#define x1 0x80
#defin |
2007-12-27 17:30:07
在电机调速中需要用模拟量作为输出,STC12C5412AD没有自带的AD。但有4路8位的PWM。用PWM做AD。具体分析如下:
图1
图2
PWM用作AD的电路原理图如图1所示。在图1的AR1的反相输入端输入如图2所示的PWM波。不失一般性,假设PWM的周期为T,脉宽为t。AR1的输出为,输入电压为则通过图1可得:
&nb |
2007-12-27 17:14:55
/******************************************************************************
函数:void IOInitial(unsigned char ionum,unsigned char iomod)
时间:2007.11. |
| |
|