91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 330KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-27
  • 語言: 其他
  • 標簽: 74HC595??

資源簡介

C51單片機程序,用兩片74HC595顯示4位數碼管Keil C51程序,Protues8.0仿真。
只占單片機3位I/O口.

資源截圖

代碼片段和文件信息

#include?
#include?

sbit?SDA1?=?P3^6;????//串行數據輸入對應595的14腳SER
sbit?SCL1?=?P3^7;?????//移位寄存器時鐘輸入對應595的11腳SCK
sbit?SCL2?=?P3^4;?????//存儲寄存器時鐘輸入對應595的12腳RCK

//unsigned?char?code?duan[]={0xc00xf90xa40xb00x990x920x820xf80x800x90};
unsigned?char?code?disp[16]= {0x3f0x060x5b0x4f0x660x6d0x7d0x07
0x7f0x6f0x770x7c0x580x5e0x790x71};?/***數碼***/


?????????????????????????//0??1???2???3???4???5???6???7???8???9
//unsigned?char?code?wei[]={0x010x020x040x080x100x200x400x80};
unsigned?char?code?wei[]={0xfe0xfd0xfb0xf70xef0xdf0xbf0x7f};
???????????????????????
void?delay2ms(void)
{
???unsigned?char?ij;
???for(i=133;i>0;i--)
???for(j=6;j>0;j--);
}
///========
void?c595_in(unsigned?char?Data)
{
unsigned?char?i;
for(i?=?0;?i? {
?????? SCL1?=?0;????????//先將移位寄存器控制引腳置為低????
?????? _nop_();
?????? if((Data?&?0x80)==?0x80)
???????????SDA1?=1;
?????? else
???????????SDA1?=0;
?
?????? Data?<<=?1;???????????//將數據的次高位移到最高位
?
?????? SCL1?=?1;????????????//再置為高,產生移位時鐘上升沿,上升沿時數據寄存器的數據移位
?????? _nop_();
}
}
//================
void?c595_out(void)
{
??? SCL2?=?0;???//先將存儲寄存器引腳置為低
????_nop_();
????SCL2?=?1;????//再置為高,產生移位時鐘上升沿,上升沿時移位寄存器的數據進入數據存儲寄存器,更新顯示數據。
}
///===========================
void?main(void)
{
unsigned?char?i;
for(i=0;i<8;i++)??//有八位數碼管,八位依次掃描
{
??????c595_in(wei[i]);??//先傳位碼
??????c595_in(disp[i]);??//再傳段碼
??????c595_out();
??????delay2ms();?????????????//延遲時間2ms以內
}
}



?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-04-05?22:32??ch595_Led\
?????文件????????7766??2016-04-05?22:10??ch595_Led\Backup?Of?led.pdsbak
?????目錄???????????0??2016-04-05?21:55??ch595_Led\Explorer?16\
?????文件???????11377??2012-05-08?16:10??ch595_Led\Explorer?16\adc.c
?????文件????????5670??2012-05-08?16:10??ch595_Led\Explorer?16\adc.h
?????文件????????7067??2012-05-08?16:10??ch595_Led\Explorer?16\banner.c
?????文件????????4265??2012-05-08?16:10??ch595_Led\Explorer?16\buttons.c
?????文件????????4829??2012-05-08?16:10??ch595_Led\Explorer?16\buttons.h
?????目錄???????????0??2016-04-05?21:55??ch595_Led\Explorer?16\Debug\
?????文件??????919152??2012-06-28?09:43??ch595_Led\Explorer?16\Debug\Debug.cof
?????文件????????8836??2012-05-08?16:10??ch595_Led\Explorer?16\eeprom.c
?????文件???????13527??2012-05-08?16:10??ch595_Led\Explorer?16\eeprom.h
?????文件??????109555??2012-07-18?10:00??ch595_Led\Explorer?16\Explorer?16.pdsprj
?????文件?????????899??2016-04-05?21:56??ch595_Led\Explorer?16\Explorer?16.pdsprj.WIN-NK21FQHWAJ6.Administrator.workspace
?????文件????????6501??2012-05-08?16:10??ch595_Led\Explorer?16\lcd.c
?????文件????????6844??2012-05-08?16:10??ch595_Led\Explorer?16\lcd.h
?????文件???????54308??2012-05-08?16:10??ch595_Led\Explorer?16\p24FJ128GA010.gld
?????文件??????101183??2012-05-08?16:10??ch595_Led\Explorer?16\p24FJ128GA010.h
?????文件????????6012??2012-05-08?16:10??ch595_Led\Explorer?16\PIC24ExplDemo.c
?????文件???????14919??2012-05-08?16:10??ch595_Led\Explorer?16\rtcc.c
?????文件????????5133??2012-05-08?16:10??ch595_Led\Explorer?16\rtcc.h
?????文件????????6679??2012-05-08?16:10??ch595_Led\Explorer?16\spimpol.c
?????文件????????9637??2012-05-08?16:10??ch595_Led\Explorer?16\spimpol.h
?????文件????????2346??2012-05-08?16:10??ch595_Led\Explorer?16\system.h
?????文件????????9271??2012-05-08?16:10??ch595_Led\Explorer?16\tbanner.c
?????文件????????2991??2012-05-08?16:10??ch595_Led\Explorer?16\timer.c
?????文件????????2775??2012-05-08?16:10??ch595_Led\Explorer?16\timer.h
?????文件????????5256??2012-05-08?16:10??ch595_Led\Explorer?16\uart2.c
?????文件????????4189??2012-05-08?16:10??ch595_Led\Explorer?16\uart2.h
?????文件????????4066??2012-05-08?16:10??ch595_Led\Explorer?16\vbanner.c
?????文件????????4670??2016-04-05?22:30??ch595_Led\led
............此處省略15個文件信息

評論

共有 條評論