• Controls the box system based on the SST89C58 monolithic integrated circuit’s long-distance lamp

        Abstract: Take the large-scale place lighting attachment’s remote control as a goal, introduced that controls the box system’s software and hardware design based on the SST89C58 monolithic integrated circuit’s long-distance lamp. This system through the RS-485 main line and the PC superior machine correspondence, realizes the long-distance range, the multiple joint control.

        Key word: Monolithic integrated circuit; IAP; Remote control; Communication protocol: SST89C58

    The computer is the nowadays information age symbol, realizes the long-distance real-time automated control through the computer is one tendency which the present will develop. In the large-scale market, the hotel, the sports complexes and in the recreation area, usually has many lighting attachments. The former stop-go control and the electric power switch control, need the staff to arrive personally the scene operation frequently frequently, or pulls to the control room meets the long 220V electric wire, timeliness, the security is bad. In order to realize the staff to be possible to disperse in the control room carries on the real-time effective state control and the condition in each room far-end lighting attachment inquires, the author developed one kind to control the box system based on monolithic integrated circuit’s long-distance lamp. This system controls the box by PC superior machine control many far-end lamps, through the RS-485 main line serial transmission instruction, the transmitting range is farthest may reach 1.2km, and strengthens the serial communication agreement the formulation, reduced the noise jamming. A desk lamp controls the box to be possible to carry on the control to 16 street lights. The lamp controls in the box to select the SST89C58 monolithic integrated circuit, its convenient IAP function may online download the Hex document and carry on the debugging, does not need to use the programmer many times.

    1 system structure and function

    The long-distance lamp controls box system’s structure like chart l to show, the PC superior machine places in the control room, various lamphouses nearby lay aside nearby the lighting attachment. By the PC superior machine transmission control command, controls through the RS-485 main line the instruction serial transmission for various fars-end lamp the box, like this may in the control room the real-time stop-go control, inquires each lamp’s condition. From the transmitting range and the performance-to-price ratio aspect considered that selects the RS-485 main line. RS-485 is the balanced line, may realize the long-distance range, the multiple joint control. This design’s key point is the lamp controls the box. Below will control the box take a desk lamp as the example introduction system’s software and the hardware design.

    2 hardware designs

    2.1 key elements

    The design system selects Silicon Storage. Technology Corporation promotes has IAP (In-Application Programming) the function SST89C58 monolithic integrated circuit. It in command system, hardware architecture and on the internal resources is completely compatible with the standard 8052 monolithic integrated circuits, simultaneously increased the internal procedure to save Flash the capacity, might reach 36KB. And increased has programmed the related 6 special function register and 2 with Flash with the watch-dog replacement related special function register. Uses a general routine to the SST89C58 IAP function to compile [1], selects Keil Corporation μVision the simulation software to carry on the programming simulation. Will produce the Hex document downloaded directly through the RS-232 serial port from PC to the monolithic integrated circuit on moves the debugging, the use is convenient, reduced the development cycle. The ULN2803A component is the monolithic integrated high pressure which, the big electric current Darington transistor array TI Corporation produces. This array tube is composed of 8 NPN the Darington. Its characteristic is the current gain is high, load capacity strong (output current may reach 500mA), the working voltage high (pressure resistance to reach 50V). Selects: The X5045 component is 4K the SPI electricity may clean the memory, after using in the power failure, preserves from machine the station number. When Maxim Corporation’s MAX485 component is the general half-duplex transceiver, the transmission speed is 9.6Kb/s, the transmitting range may reach 1.2km. to be possible to realize the superior machine and between monolithic integrated circuit’s serial port asynchronous communication.

    Figure 2

        2.2 system hardware core

    The long-distance lamp controls box system’s hardware core chart as shown in Figure 2, take the SST89C58 monolithic integrated circuit as a core, with the P0 mouth and the P2 mouth clear signal control, pays attention to the P0 mouth to add on pulls the resistor. Carries on the electric current through 2 ULN2803 to enlarge, may actuate 16 groups relays. Because internal has the common cathode clamping diode, may adapt the perceptual load, therefore the out-port may omit the massive diodes. SST89C58 actuates 16 groups relays, may control 16 street light signals. If increases the control signal, may increase 8255 components to expand the parallel interface. Preserves the RS-485 network with X5045 from machine the station number. SST89C58 monolithic integrated circuit’s P1.2 pin uses for when simulates X5045 clock input signal SCK, CS=0, serial output SO in the clock signal drops along effectively, serial input SI in the rise along effective (WP=1). The concrete operations also need to read in the condition character. The serial port part selects MAX485. And, RE and DE meet in the same place RD(P3.7) control by the monolithic integrated circuit. Pulls lowers for the receive is effective, pulls is high effective for the transmission. This system also has the electricity automatic reset and the circular telegram directive function. Designs when PCB should pay attention to the reasonable wiring, carries on the filter rectification to the monolithic integrated circuit power source, and is far away from the noise source.

    3 system software designs

    Has the easy to operate, the programming efficiency with the C language compiler development monolithic integrated circuit to be high and simulation debugging easy and so on prominent characteristic. The C51 edition are many, this system software selects German Keil Software Corporation’s Keil the C51 compiler development. This compiler based on the Windows platform integrated development environment, may edit, the translation and the debugging assembly language procedure and the C51 procedure, but may also the analog simulation I/O mouth, the timer/counter, the serial port and the interrupt and so on monolithic integrated circuit unique functional units, the function is formidable.This system’s software design by the master routine, the interrupt routine, the serial receive subroutine, the serial transmission subroutine, the X5045 read-write subroutine and certain functions realizes the subroutine. And: The X5045 read-write subroutine must carry on the precise operation to the clock, with the assembly language compilation, other uses the C language to compile.

    3.1 master routine designs

    In the master routine, first SST89C58 and the X5045 initialization, then waits for the new order. When NewData=1, expressed already receives to an effective order frame, otherwise continues to wait. Then judges whether is this aircraft address, then if judgment control command, otherwise continues to wait. The superior machine transmission assigns the string of character, indicated separately turns on the light, orders and so on turning off a light, inquiry, establishment. Through the string of character comparison, judges the command instruction, jumps to the corresponding entrance subroutine in; After operating successfully, through the serial port transmission subroutine returns corresponding prompt symbol, its concrete flow as shown in Figure 3. In this system, the superior machine man-machine interaction contact surface develops by C Builder, as space is limited, in this omitting.

    3.2 serial port interrupt routine design

    In order to strengthen the anti-jamming, the effective area divided the noise and the data is advantageous for the operation, the serial port interrupt routine strengthened communication protocol formulation [2], realized the method is specifically Canada starts to symbolize and the end mark. The noise is appears by the stochastic byte, through the test and the experiment, discovered when this system 0×00 heel 0xFF the noise is not easy to occur. Therefore, the establishment started to symbolize is 0×000xFF, the end mark line feeds symbol 0×0D0×0A for the carriage return. If receive order frame success, then sets at NewData=1, expressed that the new order is effective. Considered investigates the error detection, the data selects the short package method. Middle uses the time delay, guaranteed that the outset position is reliable. Serial port interrupt routine flow as shown in Figure 4. The subprogram detailed list is as follows.

    // serial meets the child function

    INT8U ReUART (INT8U*ch)

    {INTl6U delay=6000;

    while (–delay) // time delay

    {if(RI),/serial receive interrupt symbol

    {RI=0; // receive interrupt symbol software repositions

    , *ch=SBU F=//reads the data buffer

    return 1;}// success returns to l

    }

    return(0); // receive defeat returns 0

    )

    // serial interrupt handling routine

    void UART_Inter(void)interrupt 4

    {INT8U ii;

    INT8U temp, templ;

    ReUART (&temp,); // receives 2 bytes continuously first

    ReUART(&templ);

    // starts to symbolize

    if((temp==0×00)&&(templ==0xFF))

    // receives an order frame continuously

    {for (ii=0; ii<12; ii )

    {if(ReUART(&buff[ii])==0)

    goto Inter. _end;}// jumps out the interrupt

    if((buf[10]==0×0D)&&(buf[ll]==0×0A)),/end mark

    NewData=l; // orders the sign to be effective newly

    }

    Inter_end: ; // interrupt export

    }

    4 conclusions

    Controls the box system based on the SST89C58 long-distance lamp to be possible to realize a PC superior machine most to control 256 lamps to control the box, the transmitting range is farthest may reach 1.2km, each desk lamp controls the box to be possible to carry on the control to 16 street lights. Has realized the centralized management, the dispersion control function. This system enhances the anti-jamming through the software and hardware, and has the good extension, the structure simple, invests few, the practical application indicated that has the strong usability.

    Share/Save/Bookmark

    Thursday, September 4th, 2008 at 03:06
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