【正文】
電路由圖38所示,當TLP5211得輸入端Vin為高電平時,對應的輸出端Vout為低電平;輸入端Vin為低電平時,對應的輸出端Vout為高電平。H橋驅動電路是由四個開關管構成,這樣很方便實現直流電機的四象限運行。圖39 驅動電路如圖39所示,控制直流電機的轉速。同時要在電機的兩端連接四個續(xù)流二極管,當電機的正反轉狀態(tài)發(fā)生改變時,電樞電流方向不能立刻改變,需用二極管續(xù)流,以免在電機內產生強大的沖擊電流燒壞電機。該模塊有三個控制輸入端口:ENA、ININ2。表310 L298對直流電機控制的邏輯真值表電機狀態(tài)引腳ENAIN1IN2正轉HHL反轉HLH快速停止HXX自由停止LXX由上表可以看出,當ENA為高電平,控制芯片使能,IN1控制電機的正轉方向,IN2控制電機的反轉方向。由圖310可以看出,PWM波只有一種極性,當IN1為高電平IN2為低電平時OUT1輸出波形與PWM波形一樣;當IN2為高電平IN1為低電平時OUT2輸出波形與PWM波形一樣。從而簡化了電路,節(jié)約了單片機的I/O端口問題。 (2)BI:滅燈輸入,是為控制多位數碼顯示的滅燈所設置的。其結果和加入滅燈信號的結果一樣,將0熄滅。、電機正轉;,電機反轉。這樣做可以保證LED能正常地工作。選用霍爾元件CS3020作為測速的傳感器,在電機轉軸的圓周上黏上磁鋼,讓霍爾開關靠近磁鋼,轉軸旋轉時,就會不斷有信號脈沖輸出。該探頭由霍爾元件CS3020和磁鋼組成測量電路。在本設計中只用到了它的一個電路。圖314為CD40106整形后的波形圖。 展望基于MSP430單片機的直流電機調速系統(tǒng)是現代社會在工業(yè)發(fā)展的一個重要階段,隨著對調速的要求不斷提高和產量的增長,越來越多的生產機械要求調速系統(tǒng)能夠更加完善。論文從選題到完成的整個過程中,得到了張育軍老師的熱情幫助和精心指導。附錄AThe Introduction of AT89C51DescriptionThe AT89C51 is a lowpower, highperformance CMOS 8bit microputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is patible with the industrystandard MCS51 instruction set and pinout. The onchip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By bining a versatile 8bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microputer which provides a highlyflexible and costeffective solution to many embedded control applications.Function characteristicThe AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16bit timer/counters, a five vector twolevel interrupt architecture, a full duplex serial port, onchip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Powerdown Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.Pin DescriptionVCC:Supply voltage.GND:Ground.Port 0Port 0 is an 8bit opendrain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance 0 may also be configured to be the multiplexed loworder address/data bus during accesses to external program and data memory. In this mode P0 has internal 0 also receives the code bytes during Flash programming,and outputs the code bytes during programverification. External pullups are required during programverification.Port 1Port 1 is an 8bit bidirectional I/O port with internal Port 1 output buffers can sink/source four TTL 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal 1 also receives the loworder address bytes during Flash programming and verification.Port 2Port 2 is an 8bit bidirectional I/O port with internal Port 2 output buffers can sink/source four TTL 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current, because of the internal 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses. In this application, it uses strong internal pullupswhen emitting 1s. During accesses to external data memory that use 8bit addresses, Port 2 emits the contents of the P2 Special Function 2 also receives the highorder address bits and some control signals during Flash programming and verification.Port 3Port 3 is an 8bit bidirectional I/O port with internal Port 3 output buffers can sink/source four TTL 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 3 pins that are externally being pulled low will source current (IIL) because of the 3 also serves the functions of various special features of the AT89C51 as listed below:Table 1 The second function of P3 portPort PinAlternate FunctionsRXD (serial input port)TXD (serial output port) (external interrupt 0) (external interrupt 1)T0 (timer 0 external input)T1 (timer 1 external input) (external data memory write strobe)(external data memory read strobe)Port 3 also receives some control signals for Flash programming and verification.RSTReset input. A high on this pin for two machine cycles while the oscillator is running resets the device.ALE/PROGAddress Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory.If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALEdisable bit has no effect if the microcontroller is in external execution mode.PSENProgram Store Enable is the read strobe to external program the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external pr