• Based on monolithic integrated circuit 89C51 asynchronous serial interface keyboard design

    Abstract: Introduced the computer asynchronous serial interface keyboard’s special design requirements and the principle of work, the union performance history, the discussion has analyzed the question which in the 89C51 chip’s structure, the function characteristic as well as the application need to pay attention, and has given the computer serial interface keyboard’s hardware schematic diagram and the software flow chart.

        In the information management system, the demonstration subsystem is overall system’s man-machine contact surface. The monitor picture presents the situation graph and the data, are the people decision-making important bases. The manual intervention method is becomes people’s decision-making the system to be able to receive the information the essential tool. Therefore manual intervention method how much and availability immediate influence overall system’s availability. Is specially big in the processing information content, in the man-machine interaction frequent system, is higher to the manual intervention method’s request.

      The author links to the work reality, designed the general asynchronous serial interface keyboard regarding monolithic integrated circuit 89C51 to take the demonstration subsystem’s expansion keyboard. The goal lies in for the demonstration subsystem increases one intervention method. The practice indicated: This keyboard improved system’s man-machine contact surface, raised system’s processing efficiency.

    1 design requirements and principle of work
    1.1 design requirements
        (1) expansion keyboard key position code conforms to the demonstration subsystem’s agreement.  
        (2) expands the keyboard and the display processor communication completes through its asynchronous serial interface, the baudrate is 9600 b/s.
      (3) expands the keyboard and the display processor communication connection level is the RS232C standard.
        (4) baudrate relative error should be smaller than 2.5%.
        (5) expands keyboard’s power source request: Directs current 5 V.
      (6) expands keyboard’s ambient temperature request: - 100~ 500°C.

    1.2 principles of work
        Expansion keyboard principle of work as shown in Figure 1. Expands the keyboard is connected through the asynchronous serial interface and the display processor, with the standard keyboard together, the display processor then has 2 keyboards. 2 keyboards may simultaneously issue the intervention order to the display processor. Therefore, demonstrated that the subsystem increased an input intervention order new way, reduced the intervention order input time, raised the manual intervention efficiency.

    2 circuit designs
        Expands the keyboard to be composed of the following several parts:
        ①Monolithic integrated circuit 89C51 and clock, reset circuit.
      ②The TTL level to RS232C level switch chip ICL232CPE, this chip only need direct current 5 V power sources.
        ③Work indicating circuit.
        ④Key position array part (8×13).
        Expansion keyboard electricity schematic diagram as shown in Figure 2.

    3 89C51 structures and performance characteristic
        89C51 is one of MCS-51 series monolithic integrated circuit’s typical products. Its interior has hardware source as shown in Figure 3.

        ①4 kB programmable E2PROM.
        ②Face control 8 b CPU.
        ③128 B internal RAM data memory.
        ④32 b bidirectional input/output line.
        ⑤1 full-duplex’s serial port.
        ⑥2 16 b timer/counter.
        ⑦5 interrupt sources, 2 interrupt priorities.⑧Clock generator.
      ⑨May the addressing 64 kB procedure memories and 64 kB exterior data memory.
      This keyboard used 89C51 internal E2PROM to take the procedure memory, outside avoided expanding the memory to take monolithic integrated circuit’s input/outlet resources; Completes the asynchronous serial communication function using the P3 mouth’s second function; Takes the connection level switch chip with piece of ICL232CPE, then has realized keyboard’s complete hardware logic. The hardware are few, the reliability is high. The entire keyboard uses 5 V direct-current power supplies; The electric circuit and the key position array separates the design. This keyboard has also overcome in the former keyboard design the key position few, not general and so on shortcomings.

    4 software function flow chart
      The software realizes the key position scanning, to eliminate the vibration, the keycode to transform, functions and so on keycode transmission. Moreover the software also realized shifted gears, the pressed key salvo function. Software function flow chart as shown in Figure 4.

    in 5 applications should pay attention question
       In heterogeneous aircraft type serial communication, when had stipulated after transmission speed, in the MCS-51 monolithic integrated circuit system selects the suitable crystal oscilation frequency to be very important. He with serial interface’s working, the power source control register PCON SMOD position, timer T1 is deciding the communication success or failure together. MCS-51 monolithic integrated circuit serial interface work in way 0:00, its baudrate fixed invariable, its size is: Crystal oscillator frequency /12. This way is the synchronous mode; Work in way 2:00 is the asynchronous system, its wave rate forcrystal oscillator frequency:①When SMOD=0, the baudrate is: Crystal oscillator frequency /64;②When SMOD=1, the baudrate is: Crystal oscillator frequency /32; The serial interface working is when 1,3 for asynchronous system, and its baudrate is invariable, besides with SMOD position value related, is mainly decided by the timer 1 overflow rate. The baudrate may determine by the equation below:
        
    But the timer 1 overflow rate and fixed time the time initializes several X decisions by the counting rate, namely:
         

        This time T1 working 2, namely 8 autoloading ways. This way may avoid through the interrupt service coming the resume load starting value, the obtained baudrate is also quite precise. In the formula X namely for the initial counting value which enters in TH1 and the TL1 Chinese dress. The timer 1 counting rate and the timer working’s choice concerns. When the election decided T1 is fixed time the working, its counting input pulse for the internal clock signal, namely each machine cycle made the register value to add 1. But each machine cycle is 12 durations of oscillation, therefore counting rate for crystal oscillator frequency 1/12. Therefore
        

        Because this expansion keyboard and display processor’s serial communication is the asynchronous system, therefore establishes his serial interface working as the way 1, timer 1 working for way 2. (9 600 b/s) asks his pre-placed value again according to the baudrate request. If time system crystal oscilation frequency 12 MHz, when SMOD elects is 1, the TH1, TL1 starting value computation is as follows:
         
        Solves the above equation to be possible to result in: X1=250(FAH) or X2=249(F9H)
      When X posts TH1, TL1, the baudrate generator produces the actual transmission speed is:
       
    Or baudrate 2=8 928.57 b/s, baudrate error 2=7%
    Which number regardless of posts, between PC machine and the monolithic integrated circuit is unable to complete the normal communication.

        If uses 11.059 2 MHz crystal oscillators, calculates X=250 FAH according to the above formula, the actual transmission speed is 9 599.83 b/s, its error is 0.001 77%, PC machine and monolithic integrated circuit’s communication may carry on normally.

        Sometimes moreover, the SMOD position’s choice can also affect the baudrate the error.

        Therefore when baudrate establishment, must give careful consideration to the SMOD position’s selection.

      When design pressed key array, should use standard keyboard’s conductive rubber thin film pressed key array, avoids the service life short, often presenting the bad contact phenomenon the old style key.

    6 conclusions
      This keyboard functional design may also go a step further refinement, like realizes capital letter locking, the small keyboard locking and so on. Because the keyboard and the main engine communication data quantity is not big, therefore has not used the USB mouth and the main engine communication. The revision, definitely may use the USB mouth and the main engine communication slightly. When this keyboard uses in some do not use the serial communication in the system, may with the TTL level be directly connected, saves the ICL232CPE chip, the electric circuit is simpler, and the P3 mouth may use the parallel output.

    Reference

    [1] He Limin .MCS-51 series monolithic integrated circuit application system design [M]. Beijing: Beijing University of Aeronautics and Astronautics Publishing house, 1990.
    [2] Zhang Youde. Monolithic miniature machine principle, application and experiment [M]. Shanghai: Fudan University publishing house, 2000.
    [3] He Limin. The monolithic integrated circuit applied technology compiles (1) [M]. Beijing: Beijing University of Aeronautics and Astronautics Publishing house, 1992

    Share/Save/Bookmark

    Wednesday, September 24th, 2008 at 12:01
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3