基于单片机10Hz-50MHz频率计系统设计
作者:互联网
//10HZ-50MHZ
#include <reg52.h>
unsigned long int fre;
unsigned char time;
unsigned int count;
unsigned int count1;
sbit LCD_RS=P1^0; //片选信号
sbit LCD_RW=P1^1; //读写信号
sbit LCD_E=P1^2; //使能信号
#define LCD_DB P0 //数据信号
unsigned char character[10]={0};//在屏幕上显示的字符串
unsigned char characterA[]={"Acquisition Done"};//在屏幕上显示的字符串
unsigned char characterB[]={"Wait a Minute....."};//在屏幕上显示的字符串
unsigned char character_1[]={"FRE= Hz"};
unsigned char FLAG = 0; //是否分频选择标志
void LCD_init(void);//初始化函数
void LCD_write_command(unsigned char command);//写指令函数
void LCD_write_data(unsigned char dat);//写数据函数
void LCD_disp_char(unsigned char x,unsigned char y,unsigned char dat);//在某个屏幕位置上显示一个字符,X(0-15),y(1-2)
void delay_n40us(unsigned int n);//延时函数
void timer_init(); //中断初始化函数
//-----------------------------延时函数---------------------------
void delay_n40us(unsigned int n) //延时函数
{
unsigned int i;
unsigned char j;
for(i=n;i>0;i--)
for(j=0;j<2;j++);
}
void delay_1s()
{
unsigned int i,j;
for(i = 0;i<100;i++)
for(j = 0;j<1000;j++);
标签:函数,50MHz,int,void,unsigned,char,单片机,LCD,频率计 来源: https://blog.csdn.net/AuroraFaye/article/details/113815606