1 / 18

Microcontroller based system design

Microcontroller based system design. Asst. Prof. Dr. Alper ŞİŞMAN. ADC Hardware.

whitney
Download Presentation

Microcontroller based system design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN

  2. ADC Hardware • Three 12-bit analog-to-digital converters are embedded and each ADC shares up to 16 external channels, performing conversions in the single-shot or scan mode. In scan mode, automatic conversion is performed on a selected group of analog inputs. • The ADC can be served by the DMA controller. An analog watchdog feature allows very precise monitoring of the converted voltage of one, some or all selected channels. An interrupt is generated when the converted voltage is outside the programmed thresholds. • To synchronize A/D conversion and timers, the ADCs could be triggered by any of TIM1, TIM2, TIM3, TIM4, TIM5, or TIM8 timer.

  3. Temperature Sensor / VBat • The temperature sensor has to generate a voltage that varies linearly with temperature. • The temperature sensor is internally connected to the ADC1_IN16 input channel which is used to convert the sensor output voltage into a digital value.

  4. ADC Hardware STM32F405xx/STM32F407xx Datasheet

  5. ADC Characteristics

  6. Tempereture/Battery Sensor Characteristics

  7. ADC Registers Activate ADC: ADON: ADCx->CR2 bit#0 Injected mode: JSWSTART: ADCx->CR2 bit#22 Regular mode: SWSTART: ADCx->CR2 bit#30 End of conversion control : JEOC: ADCx->SR bit#2 End of conversion conntrol : EOC: ADCx->SR bit#1 Read the result when conversion ends: Regular Mode: İnjected Mode: Result DATA REGISTER: ADCx->DR Result DATA REGISTER: ADCx->JDR

  8. ADC Prescaler: (if needed) ADC->CCR -> bit# 17:16 Clock: ADC1: RCC->APB2ENR -> bit#8 ADC2: RCC->APB2ENR -> bit#9 ADC3: RCC->APB2ENR -> bit#10

  9. Regular mode: Sequence length: SQR1: ADCx->SQR1 bit#23:20 SQR1,SQR2,SQR3: give the sequence in the desired order Injected mode: Sequence length: JSQR: ADCx->JSQR bit#21:20 JSQR : give the sequence in the desired order

  10. Enable temperature sensor: TSVREFE: ADC->CCR bit#23

  11. Single conversion mode operation

  12. Cont. conversion mode operation Continious conversion: CONT: ADCx->CR2 bit#1

  13. Timing Diagram

  14. Analog watchdog: ADCx->HTR: High threshold ADCx->LTR: Low threshold AWDEN: ADCx->CR1 bit#23 AWDSGL: ADCx->CR1: bit#9 AWDCH: ADCx->CR1 bit#4:0 Injected Channels: JAWDEN: ADCx->CR1 bit#22

  15. SCAN: ADCx->CR1 bit#8

  16. Channelx sampling time selection: ADCx->SMPR1 ADCx->SMPR2 ADCx->SMPR3 Wrıte the proper setting to the area of channel which will be set.

More Related