CN102098052A - Digital/analog conversion method - Google Patents

Digital/analog conversion method Download PDF

Info

Publication number
CN102098052A
CN102098052A CN200910112963XA CN200910112963A CN102098052A CN 102098052 A CN102098052 A CN 102098052A CN 200910112963X A CN200910112963X A CN 200910112963XA CN 200910112963 A CN200910112963 A CN 200910112963A CN 102098052 A CN102098052 A CN 102098052A
Authority
CN
China
Prior art keywords
pwm
conversion
microprocessor
wave signal
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN200910112963XA
Other languages
Chinese (zh)
Inventor
俞峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Scud Fujian Electronic Co ltd
Original Assignee
俞峰
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 俞峰 filed Critical 俞峰
Priority to CN200910112963XA priority Critical patent/CN102098052A/en
Publication of CN102098052A publication Critical patent/CN102098052A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a digital/analog (D/A) conversion method. In the method, an input/output (I/O) pin with pulse width modulation function is connected with a resistor by using the pulse width modulation (PWM) function of an internal band of a microprocessor (singlechip), and the resistor is connected with a capacitor to form remote control (RC) filtration. Through the PWM function in the microprocessor, the I/O pin with PWM outputs a square wave signal, the duty ratio of which corresponds to the digital quantity; and after the square wave signal is subjected to RC filtration, the square wave signal is changed into an analog signal so as to complete the D/A conversion function. By adopting the D/A conversion method, conversion and control of digital to analog can be simply completed in the occasions where the microprocessor (singlechip) is adopted; the method has simple circuit and high reliability; a D/A conversion chip does not need to be connected on the exterior of the processor, and only one I/O pin is occupied, so the resource of the microprocessor is saved; and the D/A conversion precision can be 8 to 16 bits based on the practical application condition.

Description

A kind of digital-analog convertion method
Technical field
The present invention relates to a kind of digital-to-analogue conversion (D/A) method.Specifically be pulse width modulation (PWM) the output side signal ripple that utilizes microprocessor and carry out obtaining analog quantity after the RC filtering.
Background technology
D/A switch (D/A) circuit is one of circuit commonly used in the digital system, and it mainly acts on is that digital signal is converted to analog signal, normally utilizes special-purpose D/A switch (D/A) chip to realize.Using special-purpose D/A chip, is that price is higher on the one hand, is to need interface with control chip (normally single-chip microcomputer) to be connected on the other hand, can take many IO mouths.Microprocessor (single-chip microcomputer) is very universal now, household appliances more than 90% are with monolithic processor controlled, in the low occasion of cost requirement, for cost saving, when not using the D/A special chip, have only and make single-chip microcomputer outside with some conventional D/A conversion methods, realize the D/A conversion as methods such as weighted resistance network, T type resistor network or inverted T shape resistor networks, the common ground of this several method is that needed element can be many, to element permissible accuracy also high (all will adopt precision resistance), and to take a large amount of IO pin.Many elements also mean can reduce reliability.
Summary of the invention
At the problems referred to above, that the present invention aims to provide is simple and reliable, directly utilize the internal resource of microprocessor, only takies a kind of method that an I/O mouth just can be realized digital-to-analogue conversion.
For realizing this technical purpose, technical scheme of the present invention is: pulse width modulation (PWM) function of utilizing the interior band of microprocessor (single-chip microcomputer), its I/O pin that has pulse width modulation function is connected with a resistance, and resistance is connected with an electric capacity again, constitutes RC filtering.By little PWM function of handling inside, make its I/O pin output duty cycle that has PWM and the corresponding square-wave signal of digital quantity, after this square-wave signal process RC filtering, become analog signals, thereby finished the D/A switch function.
Adopting the product of the inventive method, in the occasion of using microprocessor (single-chip microcomputer), only need resistance and electric capacity just can realize the D/A conversion, is the extremely low D/A conversion of cost; Circuit can be accomplished very simple, only takies IO pin of single-chip microcomputer, saves mcu resource greatly; Because circuit is simple, need only with two elements, reliability can improve.
Description of drawings
Fig. 1 is the circuit diagram that the inventive method adopted.
Embodiment
Concrete realization circuit is described as follows as shown in Figure 1:
Square-wave signal among the figure is the square-wave signal that microprocessor (single-chip microcomputer) is exported on the I/O pin, utilize pulse width modulation (PWM) function of single-chip microcomputer inside or produce PWM by software with the timer of single-chip microcomputer, output and the square-wave signal that sets the corresponding duty ratio of digital quantity just can obtain corresponding analog signal after RC filtering.
Such as, if the supply voltage of single-chip microcomputer is 5V, when the duty ratio of PWM was set to 37%, after the square-wave signal process R1 of the I/O mouth of PWM output, the C1 filtering, the analog quantity that obtains was exactly 5V*0.37=1.85V.The hardware PWM of common single-chip microcomputer inside is 8 or 10, and then D/A output also can be accomplished 8 or 10 resolutions, can also become the more D/A converter of multidigit resolution by software extensions when needing.

Claims (3)

1. the method for a D/A switch, it is characterized in that utilizing built-in pulse width modulation (PWM) controlled function of microprocessor (single-chip microcomputer), make the square-wave signal of its I/O pin output and the corresponding duty ratio of digital quantity, after this square-wave signal process RC filtering, become analog signals, thereby finished the D/A switch function.
2. the method as shown in claim 1, little processing inside does not have hardware PWM resource, exports but adopt software to produce pwm signal.
3. the method shown in claim 1 after RC filtering, has added one-level follower or filter again with the load capacity that improves analog quantity output or reduce output ripple.
CN200910112963XA 2009-12-15 2009-12-15 Digital/analog conversion method Pending CN102098052A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910112963XA CN102098052A (en) 2009-12-15 2009-12-15 Digital/analog conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910112963XA CN102098052A (en) 2009-12-15 2009-12-15 Digital/analog conversion method

Publications (1)

Publication Number Publication Date
CN102098052A true CN102098052A (en) 2011-06-15

Family

ID=44130941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910112963XA Pending CN102098052A (en) 2009-12-15 2009-12-15 Digital/analog conversion method

Country Status (1)

Country Link
CN (1) CN102098052A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102916702A (en) * 2012-09-29 2013-02-06 西安龙腾新能源科技发展有限公司 Digital-to-analogue conversion method based on PWM (pulse width modulation) pin of DSP (digital signal processor)
CN103869727A (en) * 2012-12-18 2014-06-18 苏州工业园区新宏博通讯科技有限公司 Integrated circuit of single chip microcomputer and digital-to-analog converter
CN103891118A (en) * 2011-09-17 2014-06-25 博朗有限公司 DC converter with adjustable output voltage
CN109932669A (en) * 2019-03-27 2019-06-25 三峡大学 A kind of digit compensated AMR magnetic field measuring device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1217098A (en) * 1996-05-07 1999-05-19 Arm有限公司 Digital to analogue converter with multiple output stages
US6958717B1 (en) * 2003-08-25 2005-10-25 Analog Devices, Inc. Method and apparatus for interconnecting analog and digital sections of A/D and D/A converters
US20060071836A1 (en) * 2004-08-30 2006-04-06 Sanyo Electric Co., Ltd. Digital to analog converter

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1217098A (en) * 1996-05-07 1999-05-19 Arm有限公司 Digital to analogue converter with multiple output stages
US6958717B1 (en) * 2003-08-25 2005-10-25 Analog Devices, Inc. Method and apparatus for interconnecting analog and digital sections of A/D and D/A converters
US20060071836A1 (en) * 2004-08-30 2006-04-06 Sanyo Electric Co., Ltd. Digital to analog converter

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103891118A (en) * 2011-09-17 2014-06-25 博朗有限公司 DC converter with adjustable output voltage
CN102916702A (en) * 2012-09-29 2013-02-06 西安龙腾新能源科技发展有限公司 Digital-to-analogue conversion method based on PWM (pulse width modulation) pin of DSP (digital signal processor)
CN103869727A (en) * 2012-12-18 2014-06-18 苏州工业园区新宏博通讯科技有限公司 Integrated circuit of single chip microcomputer and digital-to-analog converter
CN109932669A (en) * 2019-03-27 2019-06-25 三峡大学 A kind of digit compensated AMR magnetic field measuring device
CN109932669B (en) * 2019-03-27 2021-06-29 三峡大学 Digital compensation type AMR magnetic field measuring device

Similar Documents

Publication Publication Date Title
CN102098052A (en) Digital/analog conversion method
CN203086448U (en) Novel DAC circuit used for microcontroller
CN205049922U (en) Analog quantity peripheral hardware interface
CN204462760U (en) A kind of microprocessor sleeping wake-up circuit
CN202435385U (en) Compact digital-to-analogue conversion circuit
CN202548292U (en) Multi-loop active switching value monitor device
CN208272954U (en) A kind of conversion circuit of voltage to the time
CN104007320A (en) Digital RLC tester
CN202058004U (en) PLC (programmable logic controller) input circuit
CN203344866U (en) Vehicle speed signal conversion circuit
CN201113813Y (en) Power supply converter
CN203894328U (en) Digital RLC tester
CN103441544B (en) The multivoltage output control circuit of intelligent charger
CN201569699U (en) Voltage collector
CN207377842U (en) Automobile Fan speed governing interface circuit
CN105159206A (en) Analog quantity peripheral interface
CN101226514B (en) I/O port expansion circuit
CN201434687Y (en) Circuit optimizing common mode electrical level and reducing power consumption of transducers
CN208636684U (en) A kind of circuit being applicable in DDC controller simulation output interface
CN209992839U (en) Analog input switching circuit
CN208188826U (en) A kind of high-precision signal transmission conversion device
CN208351313U (en) A kind of analog output equipment of PLC host
CN203733294U (en) Remote control circuit and remote controller
CN204143631U (en) A kind of wired self-power digital communication system
CN204681251U (en) A kind of buck converter

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: SCUDCN (FUJIAN) ELECTRONICS CO., LTD.

Free format text: FORMER OWNER: YU FENG

Effective date: 20120426

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20120426

Address after: Fuzhou economic and Technological Development Zone, quick extension zone thirty-ninth, forty-fourth

Applicant after: SCUDCN (Fujian) Electronics Co., Ltd.

Address before: 350001 Gulou District, Fujian, Fuzhou, Xifeng branch alley, Chi Ting, village 21, 102

Applicant before: Yu Feng

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110615