SlideShare a Scribd company logo
1 of 21
Microprocessors systems
Vlasov Sergey
smvlasov@itmo.ru
Kirsanova Aleksandra
Analog to Digital Converter Basics
Dual Slope Analog to Digital Converter
Flash Analog to Digital Converter
Successive Approximation Analog to
Digital Converter
Sigma Delta Analog to Digital Converter
ADC resolution vs Max sampling rate
STM32 ADC
STM32 ADC
A/D conversion can be:
•Single Conversion. One sample conversion at a given instant.
•Continuous Conversion. Non-stop sample collection and conversion.
•Discontinuous Conversion. Sequential conversion of some channels in a group.
•Scan Conversion. Sequential sampling and converting of an array of channels one after
another.
To start A/D conversion, an ADC unit needs to be stimulated with a trigger signal:
•Software Trigger. A/D conversion as per demand from coded program.
•Hardware Trigger. A/D conversion as per hardware events like external interrupts or timer
events.
Timing diagram
ADC Groups
ADC Data alignment
Conversion on external trigger and
trigger polarity
ADC with DMA
Example schematic
ADC
Timer
TRIG
IN0..15 DMA
Request
Data
Memory
DMA USART
DMA
TC Interrupt
Handler
Software
Start transfer
Data
to
PC
IRQ
Algorithm
1. Enable ADC and config required GPIO pins.
2. Config ADC:
1. Set work with DMA.
2. Set start convert by external trigger and choose trigger source.
3. Set scan mode.
4. Set number of converting and queue.
3. Config timer for create trigger event on update.
4. Config DMA stream for ADC and enable interrupt on TC.
5. Config USART and DMA for Transmit function.
6. In DMA IRQ Handler config buffer and start transmission by enabling
DMA.
Steps of initialization system
DMA Example
int main()
{ ADC1->CR2 = ADC_CR2_ADON | // Enable ADC
ADC_CR2_DMA | ADC_CR2_DDS | // Enable DMA access
ADC_CR2_EXTEN_0 | // Enable external trigger
ADC_CR2_EXTSEL_X; // Choose external trigger
ADC1->CR1 = ADC_CR1_SCAN; // Set scan mode
ADC1->SQR1 = (NUMBER_OF_CONV - 1) << ADC_SQR1_L_POS;//Set numb of conventions
ADC1->SQR3 = NUMBER_OF_CHANNEL << ADC_SQR3_SQ1_POS | //Set channels queue
NUMBER_OF_CHANNEL << ADC_SQR3_SQ2_POS …;
… //Timer init
TIMX->CR2 |= TIM_CR2_MMS_1; // Enable triggering
…
DMA1_Stream6->CR = DMA_SxCR_CIRC | // Set DMA circ mode
DMA_SxCR_MINC | // Set memory increase mode
DMA_SxCR_MSIZE_0 | // Set memory size to 16-bit
DMA_SxCR_PSIZE_0 | // Set peripheral size to 16-bit
DMA_SxCR_TC; // Enable interrupt on TC
DMA1_Stream6->NDTR = NUMBER_OF_CONV;
// Enable DMA
}
Servo for control
PID
Final system schematic
PLANT
Motor with gears
and potentiometer
( 5-wire servo)
H-bridge
STM32
ADC
Timer PID
u
Thank you for attention
www.ifmo.ru

More Related Content

Similar to ADC conversion methods and STM32 implementation

5.3 Data conversion
5.3 Data conversion5.3 Data conversion
5.3 Data conversionlpapadop
 
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics Felipe Prado
 
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptxCdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptxRajSingh616745
 
04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)antonio michua
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Rodrigo Almeida
 
Galil dmc14x5 34x5_catalog
Galil dmc14x5 34x5_catalogGalil dmc14x5 34x5_catalog
Galil dmc14x5 34x5_catalogElectromate
 
2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf
2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf
2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdfssuser2a2430
 
Software Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGASoftware Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGAIRJET Journal
 
intelligent braking system report
intelligent braking system reportintelligent braking system report
intelligent braking system reportSumit Kumar
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORAnil Yadav
 
Micro controller based DAQ
Micro controller based DAQMicro controller based DAQ
Micro controller based DAQMurugappa Group
 
Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesCorrado Santoro
 
Bca 2nd sem-u-3.2-basic computer programming and micro programmed control
Bca 2nd sem-u-3.2-basic computer programming and micro programmed controlBca 2nd sem-u-3.2-basic computer programming and micro programmed control
Bca 2nd sem-u-3.2-basic computer programming and micro programmed controlRai University
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
ADDA_Lecture_P1.ppt
ADDA_Lecture_P1.pptADDA_Lecture_P1.ppt
ADDA_Lecture_P1.pptssuserf2cc17
 
ADDA_Lecture_P1. digital techniques lecture
ADDA_Lecture_P1. digital techniques lectureADDA_Lecture_P1. digital techniques lecture
ADDA_Lecture_P1. digital techniques lectureSindhu Mani
 
Galil dmc3000 catalog
Galil dmc3000 catalogGalil dmc3000 catalog
Galil dmc3000 catalogElectromate
 

Similar to ADC conversion methods and STM32 implementation (20)

5.3 Data conversion
5.3 Data conversion5.3 Data conversion
5.3 Data conversion
 
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
 
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptxCdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
Cdd Dual Sample Pulse width modulation Flow Chart Diagram.pptx
 
04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)04 adc (pic24, ds pic with dma)
04 adc (pic24, ds pic with dma)
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015
 
presentation_28 (1).pptx
presentation_28 (1).pptxpresentation_28 (1).pptx
presentation_28 (1).pptx
 
Galil dmc14x5 34x5_catalog
Galil dmc14x5 34x5_catalogGalil dmc14x5 34x5_catalog
Galil dmc14x5 34x5_catalog
 
2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf
2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf
2012 Techniques for Verification and Debugging of LPDDR3 Memory Designs.pdf
 
Software Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGASoftware Design of Digital Receiver using FPGA
Software Design of Digital Receiver using FPGA
 
intelligent braking system report
intelligent braking system reportintelligent braking system report
intelligent braking system report
 
ANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTORANALOG TO DIGITAL CONVERTOR
ANALOG TO DIGITAL CONVERTOR
 
Micro controller based DAQ
Micro controller based DAQMicro controller based DAQ
Micro controller based DAQ
 
Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR Libraries
 
Bca 2nd sem-u-3.2-basic computer programming and micro programmed control
Bca 2nd sem-u-3.2-basic computer programming and micro programmed controlBca 2nd sem-u-3.2-basic computer programming and micro programmed control
Bca 2nd sem-u-3.2-basic computer programming and micro programmed control
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
ADDA_Lecture_P1.ppt
ADDA_Lecture_P1.pptADDA_Lecture_P1.ppt
ADDA_Lecture_P1.ppt
 
ADDA_Lecture_P1. digital techniques lecture
ADDA_Lecture_P1. digital techniques lectureADDA_Lecture_P1. digital techniques lecture
ADDA_Lecture_P1. digital techniques lecture
 
Galil dmc3000 catalog
Galil dmc3000 catalogGalil dmc3000 catalog
Galil dmc3000 catalog
 

More from GautamDhargalkar1

More from GautamDhargalkar1 (7)

Lecture 5.pptx
Lecture 5.pptxLecture 5.pptx
Lecture 5.pptx
 
Lecture 4.pptx
Lecture 4.pptxLecture 4.pptx
Lecture 4.pptx
 
Lecture 3.pptx
Lecture 3.pptxLecture 3.pptx
Lecture 3.pptx
 
Lecture 2.pptx
Lecture 2.pptxLecture 2.pptx
Lecture 2.pptx
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Indian_Flag_Template.potx
Indian_Flag_Template.potxIndian_Flag_Template.potx
Indian_Flag_Template.potx
 
Typical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.ppt
Typical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.pptTypical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.ppt
Typical_Techniques_for_Eliminating_Physical_Contradictions-Needs corrections.ppt
 

Recently uploaded

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Recently uploaded (20)

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 

ADC conversion methods and STM32 implementation

  • 2. Analog to Digital Converter Basics
  • 3. Dual Slope Analog to Digital Converter
  • 4. Flash Analog to Digital Converter
  • 5. Successive Approximation Analog to Digital Converter
  • 6. Sigma Delta Analog to Digital Converter
  • 7. ADC resolution vs Max sampling rate
  • 9. STM32 ADC A/D conversion can be: •Single Conversion. One sample conversion at a given instant. •Continuous Conversion. Non-stop sample collection and conversion. •Discontinuous Conversion. Sequential conversion of some channels in a group. •Scan Conversion. Sequential sampling and converting of an array of channels one after another. To start A/D conversion, an ADC unit needs to be stimulated with a trigger signal: •Software Trigger. A/D conversion as per demand from coded program. •Hardware Trigger. A/D conversion as per hardware events like external interrupts or timer events.
  • 13. Conversion on external trigger and trigger polarity
  • 15. Example schematic ADC Timer TRIG IN0..15 DMA Request Data Memory DMA USART DMA TC Interrupt Handler Software Start transfer Data to PC IRQ
  • 16. Algorithm 1. Enable ADC and config required GPIO pins. 2. Config ADC: 1. Set work with DMA. 2. Set start convert by external trigger and choose trigger source. 3. Set scan mode. 4. Set number of converting and queue. 3. Config timer for create trigger event on update. 4. Config DMA stream for ADC and enable interrupt on TC. 5. Config USART and DMA for Transmit function. 6. In DMA IRQ Handler config buffer and start transmission by enabling DMA. Steps of initialization system
  • 17. DMA Example int main() { ADC1->CR2 = ADC_CR2_ADON | // Enable ADC ADC_CR2_DMA | ADC_CR2_DDS | // Enable DMA access ADC_CR2_EXTEN_0 | // Enable external trigger ADC_CR2_EXTSEL_X; // Choose external trigger ADC1->CR1 = ADC_CR1_SCAN; // Set scan mode ADC1->SQR1 = (NUMBER_OF_CONV - 1) << ADC_SQR1_L_POS;//Set numb of conventions ADC1->SQR3 = NUMBER_OF_CHANNEL << ADC_SQR3_SQ1_POS | //Set channels queue NUMBER_OF_CHANNEL << ADC_SQR3_SQ2_POS …; … //Timer init TIMX->CR2 |= TIM_CR2_MMS_1; // Enable triggering … DMA1_Stream6->CR = DMA_SxCR_CIRC | // Set DMA circ mode DMA_SxCR_MINC | // Set memory increase mode DMA_SxCR_MSIZE_0 | // Set memory size to 16-bit DMA_SxCR_PSIZE_0 | // Set peripheral size to 16-bit DMA_SxCR_TC; // Enable interrupt on TC DMA1_Stream6->NDTR = NUMBER_OF_CONV; // Enable DMA }
  • 19. PID
  • 20. Final system schematic PLANT Motor with gears and potentiometer ( 5-wire servo) H-bridge STM32 ADC Timer PID u
  • 21. Thank you for attention www.ifmo.ru