Web Design And Seo For www.china-webdesign.com
Thank you for inquiry my Three Phase Power Transformers, TEL: 0086-577-62767791, E-mail: frank@chinesetransformer.com
http://www.chinesetransformer.com/key-three-phase-power-transformers-24/
Microwave oven controller working environment is relatively poor. First is the temperature of the furnace chamber is relatively high, the controller near the temperature will be relatively high, reaching 60 ℃ ~ 70 ℃; the other hand, the requirements of microwave radiation on the single-chip anti-jamming is also high, and do many fast switching gate test When a small amount of microwave leakage radiation on the controller, and repeatedly turn on and off the high-power load will produce a strong interference. So choose the right SCM is very important, appliance product design in many years, often using the 48 series and 46 series, Holtek (Holtek) 8bit microcontroller design microwave oven controller, in terms of adapting the work environment or interference to meet requirements, costs and supply of foreign chip has more obvious advantages.
In this paper, the actual product, for example, product features, requirements, and program identification and selection of chips, hardware design, software planning and preparation sections describe how to use the single-chip design microwave oven controller.
Functional requirements
Design products to first understand the product requirements, and to understand the more detailed the design repeatedly revised the less, especially on the part of the chip selection and output control directly with the hardware. This article describes the main function of the microwave oven controller is as follows:
Microwave heating power of 10 files.
Grill is heating, power file.
Heating, hot air baking temperature of multiple files.
Hybrid heating, there are three combinations of modes: barbecue and microwave, baking and microwave baking plus barbecue.
Automatically thaw weight select 20 files.
Automatic menu, six categories, all kinds of weight to select.
Show: 88:88 digital tube, surrounded with 14 icons.
Keys: function select button, start button, Cancel button, hot air baking keys, clock and timing, automatic menu of each function key, a total of 11.
Coding switch: adjust the heating time.
Another buzzer, door detection and door lights.
Program to determine the selection and chip
Understand the detailed requirements of the product, you need to determine the specific program, first select the appropriate MCU. Select the appropriate model depends on two aspects: hardware resources and software resources. To select a reasonable microcontroller must first understand the resources of the microcontroller series and sections, and then to understand what resources are needed, and below, respectively, from the hardware and software to illustrate how to select the MCU upon request. In the choice of microcontroller, the program is basically OK.
Hardware-related resources
The hardware resources are peripheral hardware such as i / o number, a special drive, the working voltage.
First, select the appropriate microcontroller family. To see whether the supply voltage and operating temperature, anti-jamming capability to meet the requirements. Holtek mcu system oscillation frequency is less than 4mhz supply voltage supply range 2.2v ~ 5.5v, compared with 3.3v ~ 5.5v when 8mhz to improve anti-jamming capability of the system, it is best to use the 5v voltage for power, when the supply voltage is higher, mcu internal high logic level amplitude tolerance voltage and high interference stronger in order to change its logic state. Operating temperature, 48 and 46 series of industrial-grade holtek microcontroller operating temperature range of -40 ℃ ~ 85 ℃, can meet the requirements of the operating temperature of the microwave oven controller. Select the appropriate series, depends on special resources, such as interruption of the mouth, the pwm, buzzer driver, a / d conversion; the specific requirements of this product, you need to detect the temperature of the furnace chamber and in the product AC fan speed, temperature detection requires a / d conversion, exchange fan speed control need to have zero interrupt 46 Series MCU, so choose this product. But this product does not require a lcd driver, high-precision a / d conversion and comparators, and other resources are not ht46r6x, ht46r5x, ht46r1x series select ht46r2x series.
Then there are the choice of i / o requirements and what kind of package microcontroller holtek microcontroller MCU of the same model a variety of packages, such as ht46r23 have dip28, or sop28 package, also have dip24, or sop24 package, its i / o 23 and 19.
According to the previously mentioned functional requirements, the i / o requirements are listed below:
Relay driver: microwave, barbecue, hot air baking, the door light / turntable, cooling fan 5 outputs the ports.
Buzzer drive: 1 output ports
The keys have 11: 11 input port
Door state detection: an input port
Coding switch to detect: 2 input port
Display digital tube: 5 9 segments of the com need 14 output port
Zero interrupt detection: an interrupt input port
Temperature detection: an a / d input port
Simple add up to a total of 20 output port, and 16 enter the port. Consider multiplexing i / o, 9 digital drive and five public-side at the same time as input detection; temperature detection can only use a / d port pb.0, zero-crossing detection can only use a separate interrupt pa.5 to detect Therefore, a total of 22 i / o, so the select 28pin ht46r2x to meet the requirements of the.
Software-related resources
Software-related resources include program space is how much of the rom size and data space ram, rom and ram when more functionality and complexity; of course, timer, interrupt, and other special resources; already selected 28pin package 46r2x-Series MCU, this product is relatively rich, program space requirements, select 4k rom and 192byteram, ht46r23 should be able to meet the requirements of the same package can choose the 28pin of ht46r24 it has 8k the rom and 384byteram can do a back-up options, so do not have to worry about insufficient resources for ic, repeatedly modify the hardware is very troublesome.
In short, the choice of resources, soft and hard take into account if the program is simple, the hardware resource requirements, you can choose to be in a small package, i / o, single-chip, an additional expansion of the ic to extend the i / o; complexity of the procedure, the hardware resources requirement is low, then select a smaller package, the software resources microcontroller.
Hardware circuit design
In the choice of the main chip, taking into account the part of the circuit design, display, key detection, the output driver and so considered because of space limitations, only a brief introduction to several key issues:
The detection circuit of the door: the door switch signal to the microcontroller detect at the same time, but also to control the microwave, barbecue, hot air baking relay power.
Supply parts: consider the digital display more content, drive current, transformers, try to choose the relay and microcontroller independent power supply, on the one hand, reducing the transformer power, while allowing the microcontroller power supply is not a relay state impact.
Zero-crossing detection and trigger: choose the optocoupler and SCR driver to achieve zero-driven, zero-detection circuit to pay attention to the appropriate filtering and isolation, reducing interference coupled through the power.
Microwave oven controller circuit diagram in Figure 1.
In addition, PCB design, attention to the strength of power to separate, pay attention to the distribution of power and ground attention to the production process. In short, the hardware design and PCB layout to ensure product functionality and performance is very important.
Software planning and preparation
Chip configuration option is set
According to the hardware circuit, the key set of coded switches and door detection part of the internal pull-up resistor; Holtek MCU the lvd function very reliable, so the reset circuit is directly connected to the vcc low voltage reset, then set the configuration options must be open , do not open easy on the poor power-on reset. Below the main option settings are listed below:
pa3/pfd: enable pfd
pull-high pb: enable
pull-high the pc: disable
pull-high pd: the enable
osc: crystal
wdt clock source: wdtosc
The WDT operation: enable
lvr: enable
lvr voltage: 3.2v
clrwdt: two instructions.
Software, the overall planning and modular decomposition
Complex functional decomposition, the variable to pass the content of the relationship between the various modules within the module as independently as possible, so let the program to improve portability, debugging faster. To simplify complex issues is the important principles of programming.
1) Main
By calling the subroutine, the integration of the functions of each module. Digital tube scanning time required is relatively high, and each of the public side to the average allocation of time, so the main program execution cycle to select a fixed cycle. Other coding switch scanning detection method, when the rotation of the encoder switch quickly, a higher pulse frequency, the scanning cycle can not be too long, integrated whole, the main select 4ms for the implementation cycle, but the display and buttons and coding switch is executed 2 times , equivalent to 2ms scan cycle.
4MHz crystal, 4ms time can execute 4000 instructions, programming under reasonable circumstances can run to the end of each subroutine, do not worry about a long time to display flicker problem when dealing with events.
2) encoding switches, buttons and door state detection
Detection due to the coding switches, buttons and door state i / o i / o multiplexing with the display driver, so be unified.
To close the show com, the state on the detection of seg, and then close the seg, and then detect the state of com.
This part of the program must complete the button to detect and eliminate jitter processing, coding switch detection, door status to jitter detection, rotating signs around to the effective key variable, coded switches, door status, etc. for the output. Other subroutine based on the corresponding button, coding, switching operations and door status, operation and function.
3) zero-crossing detection and zero trigger
The zero-crossing detection in the external interrupt program interrupt to set the cooling fan according to the current operating status after the half-power, full power on and off three states. Set directly on and off state control optocoupler state, when the half-power is required, the need to record the number of interrupts, adjust the turn-on and turn off the cycle, there is no adjustment thyristor shift method of power adjustment can reduce the electromagnetic radiation.
4) key set
The key operation setup program input conditions for the signs of rotation around the keys and coding switch, subdivided each button to set the corresponding time under what conditions, the output mode, display mode, the buzzer.
5) shows that the status is set
Set to display the digital part of the 4-byte variable 2 bytes to save four weeks icon flashing and not flashing status icon around the other two bytes set the icon flashing.
6) shows the output scan
8-byte variable content display state variables, set the corresponding com and seg digital tube to scan the display output.
7) the heat output and power control settings
Heating and power control program via a single variable input, set the current microwave, barbecue, hot air or some hybrid heating, and set within the lamp and cooling fan output.
The temperature detection and calculation
Setting a / d conversion, detection thermistor value, and filtering, as well as open the detection of short-circuit protection. The output of the fault status flag and the furnace chamber temperature. Set the state of the corresponding heating temperature in the hot air baking output program.
9) clock, time and run-time calculation and the corresponding output mode switch
Set time in the program a lot, mostly in this subroutine, such as clock, booking of the countdown, the automatic function of the multi-stage heating mode switching.
10) set the buzzer
Two the variable buz_n buz_long to set the buzzer number and length of the sound of chirping. Can be individually set the value of mono buz_long tweet, tweet mono power and button operation settings. When the timer expires, or the timing to start or fault tips, etc., need to set the tweet for a long time, set buz_n value on it.
11) timer interrupt subroutine
Timer interrupt subroutine is relatively simple, just set the interrupt number of records you can. As buzzer frequency 2khz, timer interrupt time is 250us.
The more part is: key operation, showing the status is set, clock, time and run-time calculation and the corresponding output mode switching, the heat output and power settings section.
Variable planning is very important in the preparation of the software, the following also lists several typical variable plan:
The entire product operating mode run_state to record:
run_state equ [40h]
s_hotfan equ run_state.0; hot air baking
s_micro equ run_state.1; microwave
s_grill equ run_state.2; barbecue
s_mix equ run_state 3; mixed-mode
s_auto equ run_state.4; automatically thaw
s_mu equ run_state.5; automatic menu mode
s_fast equ run_state.6; Quick Start mode
The display mode dsp_state to record:
dsp_state equ [41h]
s_time equ dsp_state.0; display clock state
s_timer equ dsp_state.1; display timing state
s_off_t equ dsp_state.2; countdown status
s_code equ dsp_state.3; display the menu or mode state
Heating the mode heat_mode variable to control the current output of its specific data as follows:
0 to turn off all output.
save microwave bit0_bit3 (10_1) 100% / 90% / 80% / 70% / 60% / 50% / 40% / 30% / 20% / 10% / 10 files, and last 4bit to record the microwave output power, in the automatic thaw, automatic menu, mixed and other non simple microwave mode, the heating power output only need to determine this variable, you set the microwave output.
bit4_bit5 save barbecue power of 100% and 50%.
the bit7 save hot air baking output.
When a mixed state, at the same time setting the corresponding bit on it.
The rational design variables useful for the preparation of the entire program, but also for the specific functions of the product planning and understanding, to identify major and critical control relationship to design suitable and appropriate general algorithm. Often write similar products, the transplantation procedure becomes very simple; such as this product digital tube change for the lcd display, basically just want to show the output section to modify the display driver ic or display ram on it, the show or show time, timer, countdown time, the menu or mode, you only need to modify the corresponding display table.
Programming and debugging
Software after a simple planning, you need a specific preparation, the task decomposition, each part is relatively simple, debugging each subroutine can be considered a separate debugging, data and status in the case of human analog input, check the output is correct. Then associated with debugging. Unless very confident, do not write the program over again debugging, so do not know exactly where there is a problem.