欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
兩個74HC595驅動8位數碼管程序+Proteus仿真
[打印本頁]
作者:
freshone
時間:
2019-1-13 21:08
標題:
兩個74HC595驅動8位數碼管程序+Proteus仿真
兩個74HC595共用了,6 個IO 口,簡單的定時器 時鐘,主要 是74HC595的控制。仿真:
11.JPG
(164.56 KB, 下載次數: 54)
下載附件
2019-1-13 21:07 上傳
單片機源碼:(位定義在 源文件)
#include<reg52.h>
#include<intrins.h>
typedef unsigned char uchar;
typedef unsigned int uint;
#define date P0
#define count 50000
#define TH_0 (65536-count)/256
#define TL_0 (65536-count)%256
uchar diss[8];
uchar code distab[17] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,
0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x40};
uint sec=0,min=0,hour=0;
void delay(uint iii)
{
while(iii--);
}
void _74hc595_dula(uchar dat)
{
uchar i=0;
sh_cp_dula=0;
st_cp_dula=0;
for(i=0;i<8;i++)
{
dula=dat>>7;
dat=dat<<1;
sh_cp_dula=1;
_nop_();
_nop_();
sh_cp_dula=0;
}
st_cp_dula=1;
_nop_();
_nop_();
st_cp_dula=0;
}
void _74hc595_wela(uchar dat)
{
uchar i=0;
sh_cp_wela=0;
st_cp_wela=0;
for(i=0;i<8;i++)
{
wela=dat>>7;
dat=dat<<1;
sh_cp_wela=1;
_nop_();
_nop_();
sh_cp_wela=0;
}
st_cp_wela=1;
_nop_();
_nop_();
st_cp_wela=0;
}
void display()
{
uchar dat,i=0;
for(dat=0xfe;dat!=0xff;dat=(dat<<1)|0x01) //1011 1111
{
_74hc595_dula(distab[diss[i++]]);
_74hc595_wela(dat);
if(i==8)i=0;
delay(100);
_74hc595_dula(0x00);
delay(100);
}
}
void disss()
{
diss[0]=hour/10;
diss[1]=hour%10;
diss[2]=16;
diss[3]=min/10;
diss[4]=min%10;
diss[5]=16;
diss[6]=sec/10;
diss[7]=sec%10;
}
void timer0_init()
{
TMOD=0x01;
EA=1;ET0=1;TR0=1;
TH0=TH_0;TL0=TL_0;
}
void main()
{
timer0_init();
while(1)
{
display();
disss();
}
}
void timer0() interrupt 1
{
static uchar j;
TH0=TH_0;TL0=TL_0;
if(++j==20)
{
j=0;
sec++;
if(sec==60)
{
sec=0;
min++;
if(min==60)
{
min=0;
hour++;
if(hour==24)
{
hour=0;
}
}
}
}
}
復制代碼
源文件:
74HC595數碼管.zip
(118.53 KB, 下載次數: 162)
2019-1-13 21:08 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
作者:
964088249
時間:
2019-5-18 11:27
老哥你的圖打不開啊,能不能發個完整的接線截圖啊
作者:
964088249
時間:
2019-5-18 12:55
請問可以看一下兩片74hc595驅動的八位數碼館proteus仿真圖嗎,你發的資料里面的圖打不開
作者:
4444iiu
時間:
2019-12-26 09:39
代碼不完整
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1