This example shows how to update at regulate period the WWDG counter using theEarly Wakeup interrupt (EWI). The WWDG timeout is set to 262ms, refresh window set to 41h and the EWI isenabled. When the WWDG counter reaches 40h the EWI is generated and in the WWDGISR the counter is refreshed to prevent a WWDG reset and led connected to PC.07is toggled.The EXTI line9 is connected to PB.09 pin and configured to generate an interrupton falling edge.In the NVIC, EXTI line9 to 5 interrupt vector is enabled with priority equal to 0and the WWDG interrupt vector is enabled with priority equal to 1 (EXTI IT > WWDG IT). The EXTI Line9 will be used to simulate a software failure: once the EXTI line9event occurs (by pressing Key push-button on EVAL board) the correspondent interruptis served, in the ISR the led connected to PC.07 is turned off and the EXTI line9pending bit is not cleared. So the CPU will execute indefinitely EXTI line9 ISR andthe WWDG ISR will never be entered(WWDG counter not updated). As result, when theWWDG counter falls to 3Fh the WWDG reset occurs.If the EXTI line9 event don抰 occurs the WWDG counter is indefinitely refreshed inthe WWDG ISR which prevent from WWDG reset. If the WWDG reset is generated, after resuming from reset a led connected to PC.06is turned on. In this example the system is clocked by the HSE(8MHz).
上傳時間: 2013-11-11
上傳用戶:gundamwzc
CH451 使用一個系統(tǒng)時鐘信號來同步芯片內(nèi)部的各個功能部件,例如,當(dāng)系統(tǒng)時鐘信號的頻率變高時,顯示驅(qū)動刷新將變快、按鍵響應(yīng)時間將變短、上電復(fù)位信號的寬度將變窄、看門狗周期也將變短。一般情況下,CH451 的系統(tǒng)時鐘信號是由內(nèi)置的阻容振蕩提供的,這樣就不再需要任何外圍電路,但內(nèi)置RC 振蕩的頻率受電源電壓的影響較大,當(dāng)電源電壓降低時,系統(tǒng)時鐘信號的頻率也隨之降低。在某些實際應(yīng)用中,可能希望CH451 提供更長或者更短的顯示刷新周期、按鍵響應(yīng)時間等,這時就需要調(diào)節(jié)系統(tǒng)時鐘信號的頻率。CH451 提供了CLK 引腳,用于外接阻容振蕩。當(dāng)在CLK 引腳與地GND 之間跨接電容后,系統(tǒng)時鐘信號的頻率將變低;當(dāng)在CLK 引腳與正電源VCC 之間跨接電阻后,系統(tǒng)時鐘信號的頻率將變高。因為CH451 的系統(tǒng)時鐘信號被用于芯片內(nèi)部的所有功能部件,所以其頻率不宜進(jìn)行大幅度的調(diào)節(jié),一般情況下,跨接電容的容量在5pF 至100pF 之間,跨接電阻的阻值在20KΩ至500KΩ之間。跨接一個47pF 的電容則頻率降低為一半,跨接一個47KΩ的電阻則頻率升高為兩倍。另外,CH451 的CLK 引腳可以直接輸入外部的系統(tǒng)時鐘信號,但外部電路的驅(qū)動能力不能小于±2mA。CH451 在CLKO 引腳提供了系統(tǒng)時鐘信號的二分頻輸出,對于一些不要求精確定時的實際應(yīng)用,可以由CLKO 引腳向單片機提供時鐘信號,簡化外圍電路。 單片機接口程序下面提供了U1(MCS-51 單片機)與U2(CH451)的接口程序,供參考。;**********************;需要主程序定義的參數(shù)CH451_DCLK BIT P1.7 ;串行數(shù)據(jù)時鐘,上升沿激活CH451_DIN BIT P1.6 ;串行數(shù)據(jù)輸出,接CH451 的數(shù)據(jù)輸入CH451_LOAD BIT P1.5 ;串行命令加載,上升沿激活CH451_DOUT BIT P3.2 ;INT0,鍵盤中斷和鍵值數(shù)據(jù)輸入,接CH451 的數(shù)據(jù)輸出CH451_KEY DATA 7FH ;存放鍵盤中斷中讀取的鍵值
標(biāo)簽: 451 ch 數(shù)碼管 實例程序
上傳時間: 2013-11-22
上傳用戶:671145514
#include <reg51.h>#include <main.h>#include <interrupt.h> cs5460a應(yīng)用電路(含源程序)bit code table_odd_even_bit[16]={0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0}; extern uchar rs485_timeout,pointer_buf485;extern uchar rs485_buf[MAX_485_LEN];extern uchar idata spi_buf[MAX_SPI_LEN];extern uchar pointer_send,send_len; extern uchar count_1s;//extern uint count_2min;extern uint count_10s;extern uchar oper_len,send_offset,chk_sum,send_i;extern bit flag_send_data,flag_level,flag_drdy,flag_data_ok;
上傳時間: 2014-01-24
上傳用戶:heart_2007
12864液晶時鐘顯示程序 LCD 地址變量 ;**************變量的定義***************** RS BIT P2.0 ;LCD數(shù)據(jù)/命令選擇端(H/L) RW BIT P2.1 ;LCD讀/寫選擇端(H/L) EP BIT P2.2 ;LCD使能控制 PSB EQU P2.3 RST EQU P2.5 PRE BIT P1.4 ;調(diào)整鍵(K1) ADJ BIT P1.5 ;調(diào)整鍵(K2) COMDAT EQU P0 LED EQU P0.3 YEAR DATA 18H ;年,月,日變量 MONTH DATA 19H DATE DATA 1AH WEEK DATA 1BH HOUR DATA 1CH ;時,分,秒,百分之一秒變量 MIN DATA 1DH SEC DATA 1EH SEC100 DATA 1FH STATE DATA 23H LEAP BIT STATE.1 ;是否閏年標(biāo)志1--閏年,0--平年 KEY_S DATA 24H ;當(dāng)前掃描鍵值 KEY_V DATA 25H ;上次掃描鍵值 DIS_BUF_U0 DATA 26H ;LCD第一排顯示緩沖區(qū) DIS_BUF_U1 DATA 27H DIS_BUF_U2 DATA 28H DIS_BUF_U3 DATA 29H DIS_BUF_U4 DATA 2AH DIS_BUF_U5 DATA 2BH DIS_BUF_U6 DATA 2CH DIS_BUF_U7 DATA 2DH DIS_BUF_U8 DATA 2EH DIS_BUF_U9 DATA 2FH DIS_BUF_U10 DATA 30H DIS_BUF_U11 DATA 31H DIS_BUF_U12 DATA 32H DIS_BUF_U13 DATA 33H DIS_BUF_U14 DATA 34H DIS_BUF_U15 DATA 35H DIS_BUF_L0 DATA 36H ;LCD第三排顯示緩沖區(qū) DIS_BUF_L1 DATA 37H DIS_BUF_L2 DATA 38H DIS_BUF_L3 DATA 39H DIS_BUF_L4 DATA 3AH DIS_BUF_L5 DATA 3BH DIS_BUF_L6 DATA 3CH DIS_BUF_L7 DATA 3DH DIS_BUF_L8 DATA 3EH DIS_BUF_L9 DATA 3FH DIS_BUF_L10 DATA 40H DIS_BUF_L11 DATA 41H DIS_BUF_L12 DATA 42H DIS_BUF_L13 DATA 43H DIS_BUF_L14 DATA 44H DIS_BUF_L15 DATA 45H FLAG DATA 46H ;1-年,2-月,3-日,4-時,5-分,6-秒,7-退出調(diào)整。 DIS_H DATA 47H DIS_M DATA 48H DIS_S DATA 49H
上傳時間: 2013-11-09
上傳用戶:xingisme
溫濕度傳感器 sht11 仿真程序 sbit out =P3^0; //加熱口 //sbit input =P1^1;//檢測口 //sbit speek =P2^0;//報警 sbit clo =P3^7;//時鐘 sbit ST =P3^5;//開始 sbit EOC =P3^6;//成功信號 sbit gwei =P3^4;//個位 sbit swei =P3^3;//十位 sbit bwei =P3^2;//百位 sbit qwei =P3^1;//千位 sbit speak =P0^0;//報警音 sbit bjled =P0^1;//報警燈 sbit zcled =P0^2;//正常LED int count; uchar xianzhi;//取轉(zhuǎn)換結(jié)果 uchar seth;//高時間 uchar setl;//低時間 uchar seth_mi;//高時間 uchar setl_mi;//低時間 bit hlbz;//高低標(biāo)志 bit clbz; bit spbz; ///定時中斷程序/// void t0 (void) interrupt 1 using 0 { TH0=(65536-200)/256;//5ms*200=1000ms=1s TL0=(65536-200)%256; clo=!clo;//產(chǎn)生時鐘 if(count>5000) { if(hlbz) { if(seth_mi==0){seth_mi=seth;hlbz=0;out=0;} else seth_mi--; } if(!hlbz) { if(setl_mi==0){setl_mi=setl;hlbz=1;out=1;} else setl_mi--; } count=0; } else count++; } ///////////// ///////延時/////// delay(int i) { while(--i); } ///////顯示處理/////// xianshi() { int abcd=0; int i; for (i=0;i<5;i++) { abcd=xianzhi; gwei=1; swei=1; bwei=1; qwei=1; P1=dispcode[abcd/1000]; qwei=0; delay(70); qwei=1; abcd=abcd%1000; P1=dispcode[abcd/100]; bwei=0; delay(70); bwei=1; abcd=abcd%100; P1=dispcode[abcd/10]; swei=0; delay(70); swei=1; abcd=abcd%10; P1=dispcode[abcd]; gwei=0; delay(70); gwei=1; } } doing() { if(xianzhi>100) {bjled=0;speak=1;zcled=1;} else {bjled=1;speak=0;zcled=0;} } void main(void) { seth=60;//h60秒 setl=90;//l90秒 seth_mi=60;//h60秒 setl_mi=90;//l90秒 TMOD=0X01;//定時0 16位工作模式 TH0=(65536-200)/256; TL0=(65536-200)%256; TR0=1; //開始計時 ET0=1; //開定時0中斷 EA=1; //開全中斷 while(1) { ST=0; _nop_(); ST=1; _nop_(); ST=0; // EOC=0; xianshi(); while(!EOC) { xianshi(); } xianzhi=P2; xianshi(); doing(); } }
上傳時間: 2013-11-07
上傳用戶:我們的船長
介紹ISE13.1 iMPACT 下載bit文件 和mcs文件的詳細(xì)步驟
上傳時間: 2013-11-17
上傳用戶:helmos
這一節(jié)的目的是使用XPS為ARM PS 處理系統(tǒng) 添加額外的IP。從IP Catalog 標(biāo)簽添加GPIO,并與ZedBoard板子上的8個LED燈相連。當(dāng)系統(tǒng)建立完后,產(chǎn)生bitstream,并對外設(shè)進(jìn)行測試。本資料為源代碼,原文設(shè)計過程詳見:【 玩轉(zhuǎn)賽靈思Zedboard開發(fā)板(4):如何使用自帶外設(shè)IP讓ARM PS訪問FPGA?】 硬件平臺:Digilent ZedBoard 開發(fā)環(huán)境:Windows XP 32 bit 軟件: XPS 14.2 +SDK 14.2
標(biāo)簽: ZedBoard FPGA ARM 訪問
上傳時間: 2013-11-06
上傳用戶:yuchunhai1990
Express Mode uses an 8-bit wide bus path for fast configuration of Xilinx FPGAs. Thisapplication note provides information on how to perform Express configuration specifically forthe Spartan™-XL family. The Express mode signals and their associated timing are defined.The steps of Express configuration are described in detail, followed by detailed instructions thatshow how to implement the configuration circui
標(biāo)簽: Spartan-XL Express XAPP FPGA
上傳時間: 2015-01-02
上傳用戶:nanxia
The introduction of Spartan-3™ devices has createdmultiple changes in the evolution of embedded controldesigns and pushed processing capabilities to the “almostfreestage.” With these new FPGAs falling under $20, involume, with over 1 million system gates, and under $5for 100K gate-level units, any design with programmablelogic has a readily available 8- or 16-bit processor costingless than 75 cents and 32-bit processor for less than $1.50.
上傳時間: 2013-10-21
上傳用戶:ligi201200
The Virtex™-4 user access register (USR_ACCESS_VIRTEX4) is a 32-bit register thatprovides direct access to bitstream data by the FPGA fabric. It is useful for loadingPowerPC™ 405 (PPC405) processor caches and/or other data into the FPGA after the FPGAhas been configured, thus achieving partial reconfiguration. The USR_ACCESS_VIRTEX4register is programmed through the bitstream with a command that writes a series of 32-bitwords.
標(biāo)簽: USR_ACCESS PowerPC XAPP 719
上傳時間: 2013-12-23
上傳用戶:yuanwenjiao
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1