【正文】
wer through the working voltage is plete sinusoidal waveform, zero zero conduction and cutoff. Zero power control mode is achieved in a given time change with load AC sine wave number adjustment of load power control method. As a result of controllable silicon is in voltage ( current ) zero crossing triggering conduction, turnon waveform sine wave is intact or half wave, so there is no silicon controlled phase shift voltage pattern exists all the shortings. Also because of controllable silicon is in onstate voltage zero crossing, its load surge current and the current rate of change is very small, in favor of silicon controlled safety work. Realization of controlled silicon zero control, need to solve two problems: (1) must be able to realize the power frequency voltage and zero crossing detection。 and in the zero pulse signal. (2) the zerocrossing pulse signal must be controlled by a singlechip output control information control. In order to control the thyristor zero trigger pulse number. These two problems are solved by software and hardware to finishProgram design is a plex task, in order to make plicated orderly, it is necessary to have the appropriate steps and methods. The steps can be summarized as the following three points:[1] The analysis system control requirements, determine the algorithm: the plex issues specific analysis to identify a reasonable calculation methods and appropriate data structures in order to determine the programming steps. This is the key to the possibility of drafting a highquality program.[2] According to the algorithm flowchart: draw the block diagram of algorithms and problemsolving steps and gradually, in order to reduce the risk of error.[3] to write the program: the selection of the appropriate mand to line up according to the block diagram of the algorithms and steps to constitute an organic whole, namely the program.The program data is an ideal method is the structured programming method. Structured programming control structure class program to use to make the appropriate restrictions, in particular, is to limit the use of steering statements (or instructions) to control the plexity of the program, and strive to procedures on the below order and execution processes consistent , make the program easy to read and easy to understand, reduce logic errors and easy to modify, and debug. According to the system control tasks, the software design of the system by the main program, initialization procedures, display of subroutine, data acquisition subroutine, the interrupt subroutine, and delay procedures.To be able to achieve the above functions, after careful analysis and sorting, and the overall function of refinement, distribution, system program is divided into the following main modules:1, the initialization module: This module on the stack, timer, counter, interrupt, and special function registers an assignment, the register is cleared, and counter / timer initial value storage.2, the key operation module: This module in the system, a power after the start of the keyboard scan, once detected, a key is in the appropriate moment, will turn to perform the corresponding handler disposed to return to the main program.3, A / D conversion module: MAX18739。s A / D conversion routine.4, the display module: This module should be able to display code for accurate display.5, the display code converter module: AD value of the binary system is converted into BCD code, BCD code converted to separate BCD code used to achieve separation, BCD code to convert digital display code in order to send the display, it is the display processing program The advance team.6 SCR zero power adjustment speed control module: used to achieve singlechip control of motor speed.In addition to the above functions, the system also has a watchdog function and work status display.Dynamic display and key scan processing time have high requirements, so the timer interrupt service routine. T1 Timer 0 (T0), the two functions. The dynamic display in a moment, only to a word line is the gating state, namely, the mon cathode is low, the corresponding bit of the field line output you want to display the field code of the character. Others the word line is still in limbo, not shown. Also in the next instantaneous display only the next LED, such a cycle for each LED. Although these characters are displayed in a variety of instantaneous rotation, but due to the residual effect of the human visual to see is each display character. The 1ms initial value loaded into the timer, then the content of the program counter (breakpoint address) onto the stack protected, then the corresponding T0 timer interrupt vector to load the program counter PC, and the program turned to T0 interrupt vector address 000BH execute the interrupt service routine.The X5045 chip poweron reset, voltage monitor, watchdog timer and EEPROM data storage four functions on the set with the multipurpose chip.1, read timing(1) CS low to select the chip。(2) send 8 Reading (READ) instruction。(3) to send the 8byte address。(4) to move the data in the memory of the selected address to the of S0 Online.Continue to provide the clock pulses can be continuously read out the data to take over the address space. Every byte of data out of the byte address is automatically increased to the next higher address, when the highest address, the address counter rolls over to 00H, the infinite loop until the CS is high, you can terminate the operating2, the write timingWREN instruction must be issued before the write timing, so that the write enable latch is set. Specific set write to latch operation is:(1) CS is first pulled low。(2) clocked into the WREN instruction。(3) CS is taken high.