AVR单片机实现电子时钟设计.pdf
AVR单片机实现电子时钟设计 #include <avr/signal.h> #include <avr/interrupt.h> #include <avr/delay.h> #include <avr/wdt.h> #include <avr/eeprom.h> #include <math.h> #include <stdlib.h> #include <string.h> #define uchar unsigned char #define uint unsigned int #define xtal 8 #define CS PA5 #define SID PA6 #define SCLK PA7 #define Set_CS() DDRA |= (1<<CS);PORTA |= (1<<CS) #define Set_SID() DDRA |= (1<<SID);PORTA |= (1<<SID) #define Set_SCLK() DDRA |= (1<<SCLK);PORTA |= (1<<SCLK) #define Clr_CS() DDRA |= (1<<CS);PORTA &=~(1<<CS) #define Clr_SID() DDRA |= (1<<SID);PORTA &=~(1<<SID) #define Clr_SCLK() DDRA |= (1<<SCLK);PORTA &=~(1<<SCLK) #define HH 2 //定义时 为2 #define MM 1 //定义分 为1 #define SS 0 //定义秒 为0 volatile unsigned char Time_h_m_s[3]={0,0,0}; //时间的时 分 秒 存贮单元 volatile unsigned char flash_sign=0x00; //==================================================================== //函数声明 void Delay(uint ms); //延时子程序 void Serial_W_1byte_to_LCD(uchar RS, uchar W_data); void Serial_send_cmd(uchar send_cmd); void Serial_send_data(uchar send_data); void Write_8bits(uchar W_bits); void LCD_Init(void); void Serial_send_string_to_xy(uchar row, uchar col, uchar *p); void Display_clock1(uchar row, uchar col, uchar *time); /*============================================================= 功能: TIMER2溢出中断函数
- Tony_zx002014-05-08都忘了评论了,挺好的,以后注释,多点儿,不然不好读懂
- long40402013-10-25很全面,就是注解太少了~
- 粉丝: 1
- 资源: 23
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助