【正文】
發(fā)現(xiàn)了,僅僅有理論知識(shí)是不夠的,理論與應(yīng)用之間存在著相當(dāng)大的差距。 總體設(shè)計(jì)框圖 如圖 1 所示 10 圖 1 總體方案圖 3 設(shè)計(jì)原理分析 鍵盤(pán)矩陣電路的設(shè)計(jì) 由于本電路所 需按鍵較多為了節(jié)省單片機(jī)的 I/O 口,故選用行列式鍵盤(pán)矩陣。 The door has a delay to ensure passengers out of / into the elevator。 S6: four floor to the call button, the button is pressed four floor elevator upstairs to, and the MCU will this signal into a fixed unit, wait to judge whether the response to this call the elevator to the floor。 S11: Elevator internal selection to a floor button, the button is pressed said elevator passengers going to the first floor, SCM according to the signal to control the operation of the lift。因此 電梯在我們的生活中起著舉足輕重的作用 。 S4 S3 S2 S1S8 S7 S6 S5S 12 S 11 S 10 S9S 16 S 15 S 14 S 13R11 0KR21 0KR31 0KR41 0K5VP 1. 0P 1. 1P 1. 2P 1. 3P 1. 7 P 1. 6 P 1. 5 P 1. 4 12 圖 3 顯示電路設(shè)計(jì) 本電路采用一個(gè) 8 為數(shù)碼管顯示,由 74ls245 來(lái)驅(qū)動(dòng) 8 位數(shù)碼管顯示電梯所到達(dá)的樓層數(shù)和電梯的運(yùn)行狀況,其中數(shù)碼管中的 6 腳( dp)亮?xí)r表示電梯此時(shí)在上行,若不亮表示電梯是在下行。在老師的熱情輔導(dǎo)之下,相信我們又上了一個(gè)新的臺(tái)階。故鍵盤(pán)矩陣掃描是本系統(tǒng)軟件設(shè)計(jì)的重要一部分,另外要把鍵盤(pán)掃描到的各層的按鍵信息存儲(chǔ)起來(lái),然后和電梯的運(yùn)行狀態(tài)比較,判斷是否響應(yīng)各層呼叫(電梯只響應(yīng)同方向呼叫),最后就是樓層顯示部分了,此次設(shè)計(jì)是通過(guò)延時(shí)電路來(lái)實(shí)時(shí)顯示電梯所在的位置的。采用定時(shí)器延時(shí)來(lái)控制電梯的位置校驗(yàn),采用 8 位 LED 靜態(tài)顯示來(lái)實(shí)時(shí)顯示電梯所在樓層,并用 74ls245 來(lái)驅(qū)動(dòng) LED 顯示。 The keyboard circuit as shown in figure 2: 4 Fig. 2 overall plans the smallest singlechip system design If the circuit group reset circuit and clock circuit two parts, wherein the reset circuit using a bination key manual reset and automatic poweron reset, the circuit in Figure 3 ( left) shows: 9 feet for the MCU reset. The clock circuit as shown in Figure 3 ( right) shows: crystal oscillator is used in 12MHZ, XATL2 and XATL1 were 18 and 19 feet of scm. Fig. 3 overall plans 5 display circuit design This circuit uses a 8 digital tube display, from 74ls245 to drive 8 digital tube display elevator to arrive the number of floors and the operational status of the elevator, wherein the digital tube of 6 feet ( DP ) bright said elevator at this point in the uplink, if not bright said elevator in the downlink. microcontroller P2 port as the output port and the output activelow. The circuit shown in figure 4: Fig. 4 overall plans motor positive inversion of control In this design in order to facilitate the motor positive and negative use two light tube to represent, as shown in Figure 5 : the use of SCM P0 port output port to drive the luminous tube, as is the P0 to add resistance, in which L1 light indicates the motor forward, L2 lights, L3 light indicates that the motor reverse motor stop, while the elevator door. L3 out that the elevator door, elevator running L1 and L2 must have a bright, to express elevator uplink and downlink Fig. 5 overall plans 6 system software design Because the design of the keyboard matrix to replace the outgoing select button, which is the direction of the elevator call button and choose according to these keys to decide, so the chip to scan the keyboard constantly to get the call state. In order to control the operation of the lift. The keyboard matrix scanning is an important part of the softw