#include<iom16v.h> #include<macros.h> #define uint unsigned int #define uchar unsigned char uint a,b,c,d=0; void delay(c) { for for(a=0;a<c;a++) for(b=0;b<12;b++); }; uchar tab[]={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,
標(biāo)簽: AVR 單片機(jī) 數(shù)碼管
上傳時(shí)間: 2013-10-21
上傳用戶:13788529953
本文檔著重介紹如何使用Philips 半導(dǎo)體的收發(fā)器PCA82C250[1]和PCA82C251[2]實(shí)現(xiàn)物理媒體連接子層物理信令子層和數(shù)據(jù)鏈路層之間的連接是通過集成的協(xié)議控制器實(shí)現(xiàn)的這些產(chǎn)品有像Philips 的PCx82C200 SJA1000 等而媒體相關(guān)接口負(fù)責(zé)連接傳輸媒體譬如將總線節(jié)點(diǎn)連接到總線的連接器像Philips 的TJA1050[3]或PCA82C250[4]等收發(fā)器
上傳時(shí)間: 2013-10-19
上傳用戶:31633073
三種方法讀取鍵值 使用者設(shè)計(jì)行列鍵盤介面,一般常採用三種方法讀取鍵值。 中斷式 在鍵盤按下時(shí)產(chǎn)生一個(gè)外部中斷通知CPU,並由中斷處理程式通過不同位址讀資料線上的狀態(tài)判斷哪個(gè)按鍵被按下。 本實(shí)驗(yàn)採用中斷式實(shí)現(xiàn)使用者鍵盤介面。 掃描法 對(duì)鍵盤上的某一行送低電位,其他為高電位,然後讀取列值,若列值中有一位是低,表明該行與低電位對(duì)應(yīng)列的鍵被按下。否則掃描下一行。 反轉(zhuǎn)法 先將所有行掃描線輸出低電位,讀列值,若列值有一位是低表明有鍵按下;接著所有列掃描線輸出低電位,再讀行值。 根據(jù)讀到的值組合就可以查表得到鍵碼。4x4鍵盤按4行4列組成如圖電路結(jié)構(gòu)。按鍵按下將會(huì)使行列連成通路,這也是見的使用者鍵盤設(shè)計(jì)電路。 //-----------4X4鍵盤程序--------------// uchar keboard(void) { uchar xxa,yyb,i,key; if((PINC&0x0f)!=0x0f) //是否有按鍵按下 {delayms(1); //延時(shí)去抖動(dòng) if((PINC&0x0f)!=0x0f) //有按下則判斷 { xxa=~(PINC|0xf0); //0000xxxx DDRC=0x0f; PORTC=0xf0; delay_1ms(); yyb=~(PINC|0x0f); //xxxx0000 DDRC=0xf0; //復(fù)位 PORTC=0x0f; while((PINC&0x0f)!=0x0f) //按鍵是否放開 { display(data); } i=4; //計(jì)算返回碼 while(xxa!=0) { xxa=xxa>>1; i--; } if(yyb==0x80) key=i; else if(yyb==0x40) key=4+i; else if(yyb==0x20) key=8+i; else if(yyb==0x10) key=12+i; return key; //返回按下的鍵盤碼 } } else return 17; //沒有按鍵按下 }
上傳時(shí)間: 2013-11-12
上傳用戶:a673761058
Single-Ended and Differential S-Parameters Differential circuits have been important incommunication systems for many years. In the past,differential communication circuits operated at lowfrequencies, where they could be designed andanalyzed using lumped-element models andtechniques. With the frequency of operationincreasing beyond 1GHz, and above 1Gbps fordigital communications, this lumped-elementapproach is no longer valid, because the physicalsize of the circuit approaches the size of awavelength.Distributed models and analysis techniques are nowused instead of lumped-element techniques.Scattering parameters, or S-parameters, have beendeveloped for this purpose [1]. These S-parametersare defined for single-ended networks. S-parameterscan be used to describe differential networks, but astrict definition was not developed until Bockelmanand others addressed this issue [2]. Bockelman’swork also included a study on how to adapt single-ended S-parameters for use with differential circuits[2]. This adaptation, called “mixed-mode S-parameters,” addresses differential and common-mode operation, as well as the conversion betweenthe two modes of operation.This application note will explain the use of single-ended and mixed-mode S-parameters, and the basicconcepts of microwave measurement calibration.
上傳時(shí)間: 2014-03-25
上傳用戶:yyyyyyyyyy
電路板故障分析 維修方式介紹 ASA維修技術(shù) ICT維修技術(shù) 沒有線路圖,無從修起 電路板太複雜,維修困難 維修經(jīng)驗(yàn)及技術(shù)不足 無法維修的死板,廢棄可惜 送電中作動(dòng)態(tài)維修,危險(xiǎn)性極高 備份板太多,積壓資金 送國外維修費(fèi)用高,維修時(shí)間長 對(duì)老化零件無從查起無法預(yù)先更換 維修速度及效率無法提升,造成公司負(fù)擔(dān),客戶埋怨 投資大量維修設(shè)備,操作複雜,績效不彰
上傳時(shí)間: 2013-11-09
上傳用戶:chengxin
題目:利用條件運(yùn)算符的嵌套來完成此題:學(xué)習(xí)成績>=90分的同學(xué)用A表示,60-89分之間的用B表示,60分以下的用C表示。 1.程序分析:(a>b)?a:b這是條件運(yùn)算符的基本例子。
上傳時(shí)間: 2015-01-08
上傳用戶:lifangyuan12
RSA算法 :首先, 找出三個(gè)數(shù), p, q, r, 其中 p, q 是兩個(gè)相異的質(zhì)數(shù), r 是與 (p-1)(q-1) 互質(zhì)的數(shù)...... p, q, r 這三個(gè)數(shù)便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個(gè) m 一定存在, 因?yàn)?r 與 (p-1)(q-1) 互質(zhì), 用輾轉(zhuǎn)相除法就可以得到了..... 再來, 計(jì)算 n = pq....... m, n 這兩個(gè)數(shù)便是 public_key ,編碼過程是, 若資料為 a, 將其看成是一個(gè)大整數(shù), 假設(shè) a < n.... 如果 a >= n 的話, 就將 a 表成 s 進(jìn)位 (s
標(biāo)簽: person_key RSA 算法
上傳時(shí)間: 2013-12-14
上傳用戶:zhuyibin
一個(gè)LCD燈的小程序。不是我寫的。我只負(fù)責(zé)了調(diào)試。適用在ACEXEP1K30QC208-3上。我跑了SIMULATOR,管腳連接標(biāo)示了。我也下在電路板上試過了,沒有問題。要用到實(shí)驗(yàn)板上的兄弟們把CLK1改到TESTOUT3或者0就好了。綫幫助新手,人人有責(zé)。
標(biāo)簽: SIMULATOR ACEXEP LCD 208
上傳時(shí)間: 2015-04-10
上傳用戶:330402686
數(shù)字運(yùn)算,判斷一個(gè)數(shù)是否接近素?cái)?shù) A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上傳時(shí)間: 2015-05-21
上傳用戶:daguda
源代碼\用動(dòng)態(tài)規(guī)劃算法計(jì)算序列關(guān)系個(gè)數(shù) 用關(guān)系"<"和"="將3個(gè)數(shù)a,b,c依次序排列時(shí),有13種不同的序列關(guān)系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要將n個(gè)數(shù)依序列,設(shè)計(jì)一個(gè)動(dòng)態(tài)規(guī)劃算法,計(jì)算出有多少種不同的序列關(guān)系, 要求算法只占用O(n),只耗時(shí)O(n*n).
標(biāo)簽: lt 源代碼 動(dòng)態(tài)規(guī)劃 序列
上傳時(shí)間: 2013-12-26
上傳用戶:siguazgb
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1