//****************电子园PIC16F877A开发板 数码管动态扫描实验****************
//
//
//mcu: PIC16F877A 4MHz
//2010年12月22日9:36:29
//*************************************************************************
#include <pic.h>
#include "../head/config.h"
__CONFIG(HS&WDTDIS&LVPDIS&PWRTEN);
//HS振荡,禁止看门狗,低压编程关闭,启动延时定时器
#define srclk RC3 //移位寄存器时钟 (74595:11脚)
#define rclk RC4 //存储寄存器时钟 (74595:12脚)
#define ser RC5 //串行数据口 (74595:14脚)
//oe:输出允许 L:允许输出;H:禁止输出; (74595:13脚)
//srclr:移位寄存器清零 (L:清零) (74595:10脚)
const uchar smg_text[]={0xbf,0xfe,0xfb,0xef,0xdf,0x7f,0xfd,0xf7,};
const uchar smg[]={0x0a,0xfa,0x8c,0xa8,0x78,0x29,0x09,0xba,0x08,0x28,0x00,};
// 0 1 2 3 4 5 6 7 8 9 all
const uchar smg_bit[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0xff,};
uchar c;
uchar d;
//********************函数定义*********************
void delay1ms(uint DelayTime);
void senddata_74595(uchar SendData);
|