【正文】
ag_K==0)) //判斷是否有鍵按下 { if(count_Y10) //為消除抖動干擾只有連續(xù) 10 次掃描都有鍵按下才認為鍵已按下 { 26 Flag_K=1。 count_Y=0。 return(key)。 //返回按 鍵值 } else { count_Y++。 } } else { count_Y=0。 if(key==0) { if(count_N10) //判斷是否有鍵放開 { Flag_K=0。 count_N=0。 } else { count_N++。 } } else { count_N=0。 } } return(0x00)。 27 } /******************************************************/ void stateSel(uchar sel) { switch(sel) { case 0x00: lamp=0x7FFF。 break。 //單只亮 case 0x01: lamp=0x7F7F。 break。 //間隔 2 只亮 case 0x02: lamp=0x0FFF。 break。 //連續(xù) 4 只亮 case 0x03: lamp=0x0F0F。 break。 //間隔 2 組 4 只亮 case 0x04: lamp=0x00FF。 break。 //連續(xù) 8 只亮 case 0x05: lamp=0x000F。 break。 //連續(xù) 12 只亮 default:lamp=0x7FFF。 break。 } } /******************************************************/ void Display_Led(uint lamp) //LED 燈顯示 { uchar i=0。 uchar temp_H=0。 uchar temp_L=0。 uint Led_H=0x0000。 uint Led_L=0x0000。 temp_L=lampamp。0xFF。 temp_H=lamp0x08。 for(i=0。i8。i++) //數(shù)據(jù)轉(zhuǎn)換 高 8 位 (將顯示數(shù)據(jù)轉(zhuǎn)換為 PCB 對應值 列 1111b 轉(zhuǎn)換為 10101010) { Led_H=2。 if(temp_Hamp。0x01) 28 Led_H|=0x8000。 temp_H=1。 } for(i=0。i8。i++) //數(shù)據(jù)轉(zhuǎn)換 低 8 位 (同上, 1111b 轉(zhuǎn)換為 01010101) { Led_L=2。 if(temp_Lamp。0x80) Led_L|=0x4000。 temp_L=1。 } Led_H|=Led_L。 PortA=Led_Hamp。0xFF。 //送顯示數(shù)據(jù)到 8155 A 口 PortB=Led_H8。 //送顯示數(shù)據(jù)到 8155 B 口 } /******************************************************/ void InitTimer(void) //定時計數(shù)初始化函數(shù) { TMOD=0x10。 //T1 16 位定時器方式 1 TL1=count_T1_L。 //定時器初值 TH1=count_T1_H。 TR1=1。 //啟動定時器 ET1=1。 //允許計數(shù)器溢出中斷 EA=1。 //開總中斷 } /******************************************************/ void main(void) { uchar a=0。 uchar state=0。 bit start=0。 29 InitTimer()。 //定時器初始化 PortComd=0x03。 //8155 初始化 A 口 B 口 為輸出 C 口輸入 PortA=0xFF。 //顯示初始狀態(tài) PortB=0x7F。 while(1) { a=KeyScan8155()。 //按鍵掃描 if(a0) { switch(a) { case 0x01: start=~start。break。 //S105 開始、暫停 case 0x02: if(state=5) state=0。 else state++。 stateSel(state)。 //顯示狀態(tài)切換 break。 case 0x04: Flag_INV=~Flag_INV。break。 //反向 default: break。 } } if(Flag_TM amp。 start) { Flag_TM=0。 if(Flag_INV) lamp=(lamp15)|(lamp1)。 //順時針循環(huán) else lamp=(lamp15)|(lamp1)。 //逆時針循環(huán) 30 Display_Led(lamp)。 //LED 顯示 } } } TitleNumberRevisionSizeA4Date:9Jun2009 Sheet of File:C:\Documents and Settings\Administrator\桌面\論文\Backup of Copy of MCU_8155.DDBDrawn By:JT101JT 12MC10333pFC10433pFR11210KC10510uFC106470uF112233445566S102KJ SWDPDTD114LED3R115510VCCGNDVCCC1010.1uFC1020.1uFVCCAD012PA021AD113PA122AD214PA223AD315PA324AD416PA425AD517PA526AD618PA627AD719PA728PB029CE8PB130RD9PB231WR10PB332IO/M7PB433ALE11PB534PB635PB736TMROUT6PC037PC138TMRIN3PC239PC31PC42RESET4PC55U1028155CEEA/VP31X119X218RESET9RD17WR16INT012INT113T014T115P101P112P123P134P145P156P167P178P0039P0138P0237P0336P0435P0534P0633P0732P2021P2122P2223P2324P2425P2526P2627P2728PSEN29ALE/P30TXD11RXD10U1018051VCCD101LED3R101510D102LED3R102510D103LED3D104LED3R103510R104510R105510D106LED3R106510D107LED3D108LED3R107510R108510D105LED3D109LED3R109510D110LED3R110510D111LED3D112LED3R111510R113510R114510D115LED3R116510D116LED3D117LED3R117510R118510D113LED3GNDS104SWPBS105SWPBS103SWPBVCCGND電源指示燈電源開關(guān)電源插座C1+1V+2C13C2+4C25V6T2OUT7R2IN8R2OUT9T2IN10T1IN11R1OUT12R1IN13T1OUT14GND15VCC16U103MAX232串口12345 67891110J101D Connector 9C10810uFVCCGNDC1090.1uFC1110.1uFC1070.1uFC1100.1uFR11910KR12010KR12110KVCC12 3P101PowerIN +5V 31 g an employment tribunal claim Employment tribunals sort out disagreements between employers and employees. You may need to make a claim to an employment tribunal if: ? you don39。t agree with the disciplinary action your employer has taken against you ? your employer dismisses you and you think that you have been dismissed unfairly. For more information about dismissal and unfair dismissal, see Dismissal. You can make a claim to an employment tribunal, even if you haven39。t appealed against the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation awarded to you as a result of your failure to appeal. Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are plaining about happened. If your application is received after this time limit, the tribunal will not usually accept it. If you are worried about how the time limits apply to you, take advice from one of the anisations listed under Further help. Employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation. Most people find making a claim to an employment tribunal challenging. If you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the anisations listed under Further help. If you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out o