STM32F7 15 Analog-to-digital converter (ADC)

Started by tha, September 01, 2022, 06:48:47 AM

Previous topic - Next topic

tha

15.13.10 ADC regular sequence register 2 (ADC_SQR2)

Address offset: 0x30
Reset value: 0x0000 0000



Bits 31:30 Reserved, must be kept at reset value.

Bits 29:26 SQ12[4:0]: 12th conversion in regular sequence
     บิตเหล่านี้ถูกเขียนโดย software ด้วย the channel number (0..18) ที่กำหนดเป็นลำดับที่ 12 ใน the sequence ที่จะถูกแปลง.

Bits 24:20 SQ11[4:0]: 11th conversion in regular sequence

Bits 19:15 SQ10[4:0]: 10th conversion in regular sequence

Bits 14:10 SQ9[4:0]: 9th conversion in regular sequence

Bits 9:5 SQ8[4:0]: 8th conversion in regular sequence

Bits 4:0 SQ7[4:0]: 7th conversion in regular sequence

tha

15.13.11 ADC regular sequence register 3 (ADC_SQR3)

Address offset: 0x34
Reset value: 0x0000 0000



Bits 31:30 Reserved, must be kept at reset value.

Bits 29:25 SQ6[4:0]: 6th conversion in regular sequence
     บิตเหล่านี้ถูกเขียนโดย software ด้วย the channel number (0..18) ที่กำหนดเป็นลำดับที่ 6 ใน the sequence ที่จะถูกแปลง.

Bits 24:20 SQ5[4:0]: 5th conversion in regular sequence

Bits 19:15 SQ4[4:0]: 4th conversion in regular sequence

Bits 14:10 SQ3[4:0]: 3rd conversion in regular sequence

Bits 9:5 SQ2[4:0]: 2nd conversion in regular sequence

Bits 4:0 SQ1[4:0]: 1st conversion in regular sequence

tha

15.13.12 ADC injected sequence register (ADC_JSQR)

Address offset: 0x38
Reset value: 0x0000 0000



Bits 31:22 Reserved, must be kept at reset value.

Bits 21:20 JL[1:0]: Injected sequence length
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดจำนวนทั้งหมดของ conversions ใน the injected channel conversion sequence.
     00: 1 conversion
     01: 2 conversions
     10: 3 conversions
     11: 4 conversions

Bits 19:15 JSQ4[4:0]: 4th conversion in injected sequence (when JL[1:0]=3, see note below)
     บิตเหล่านี้ถูกเขียนโดย software ด้วย the channel number (0..18) ที่กำหนดเป็นลำดับที่ 4 ใน the sequence ที่จะถูกแปลง.

Bits 14:10 JSQ3[4:0]: 3rd conversion in injected sequence (เมื่อ JL[1:0]=3, ดู note ข้างล่าง)

Bits 9:5 JSQ2[4:0]: 2nd conversion in injected sequence (เมื่อ JL[1:0]=3, ดู note ข้างล่าง)

Bits 4:0 JSQ1[4:0]: 1st conversion in injected sequence (เมื่อ JL[1:0]=3, ดู note ข้างล่าง)

Note: เมื่อ JL[1:0]=3 (4 injected conversions in the sequencer), the ADC จะแปลง the channels ในลำดับต่อไปนี้:
          JSQ1[4:0], JSQ2[4:0], JSQ3[4:0], and JSQ4[4:0].

          เมื่อ JL=2 (3 injected conversions in the sequencer), the ADC จะแปลง the channels ในลำดับต่อไปนี้: JSQ2[4:0],
          JSQ3[4:0], and JSQ4[4:0].

          เมื่อ JL=1 (2 injected conversions in the sequencer), the ADC จะแปลง the channels โดยเริ่มจาก JSQ3[4:0], และ
          จากนั้น JSQ4[4:0].

          เมื่อ JL=0 (1 injected conversion in the sequencer), the ADC จะแปลงเฉพาะ JSQ4[4:0] channel เท่านั้น.


tha

15.13.13 ADC injected data register x (ADC_JDRx) (x= 1..4)

Address offset: 0x3C - 0x48
Reset value: 0x0000 0000



Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 JDATA[15:0]: Injected data
     บิตเหล่านี้อ่านได้เพียงอย่างเดียว. พวกมันบรรจุ the conversion result จาก injected channel x. The data ถูกวางแนวชิดซ้ายหรือชิดขวา
     ตามที่แสดงใน Figure 77 และ Figure 78.

tha

15.13.14 ADC regular data register (ADC_DR)

Address offset: 0x4C
Reset value: 0x0000 0000



Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 DATA[15:0]: Regular data
     บิตเหล่านี้อ่านได้เพียงอย่างเดียว. พวกมันบรรจุ the conversion result จาก the regular channels. The data ถูกวางแนวชิดซ้าย
     หรือชิดขวาตามที่แสดงใน Figure 77 และ Figure 78.

tha

15.13.15 ADC Common status register (ADC_CSR)

Address offset: 0x00 (offset address นี้สัมพันธ์กับ ADC1 base address + 0x300)
Reset value: 0x0000 0000

รีจิสเตอร์นี้จัดให้มี an image ของ the status bits ของ ADCs ต่างๆ. อย่างไรก็ตาม มันอ่านได้เพียงอย่างเดียวและไม่อนุญาตให้เคลียร์  the different status bits. แทนด้วยแต่ละ status bit ต้องถูกเคลียร์โดยการเขียนมันเป็น 0 ใน the corresponding ADC_SR register.



Bits 31:22 Reserved, must be kept at reset value.

Bit 21 OVR3: Overrun flag of ADC3
     บิตนี้เป็น a copy of the OVR bit in the ADC3_SR register.

Bit 20 STRT3: Regular channel Start flag of ADC3
     บิตนี้เป็น a copy of the STRT bit in the ADC3_SR register.

Bit 19 JSTRT3: Injected channel Start flag of ADC3
     This bit is a copy of the JSTRT bit in the ADC3_SR register.

Bit 18 JEOC3: Injected channel end of conversion of ADC3
     This bit is a copy of the JEOC bit in the ADC3_SR register.

Bit 17 EOC3: End of conversion of ADC3
     This bit is a copy of the EOC bit in the ADC3_SR register.

Bit 16 AWD3: Analog watchdog flag of ADC3
     This bit is a copy of the AWD bit in the ADC3_SR register.

Bits 15:14 Reserved, must be kept at reset value.

Bit 13 OVR2: Overrun flag of ADC2
     This bit is a copy of the OVR bit in the ADC2_SR register.

Bit 12 STRT2: Regular channel Start flag of ADC2
     This bit is a copy of the STRT bit in the ADC2_SR register.

Bit 11 JSTRT2: Injected channel Start flag of ADC2
     This bit is a copy of the JSTRT bit in the ADC2_SR register.

Bit 10 JEOC2: Injected channel end of conversion of ADC2
     This bit is a copy of the JEOC bit in the ADC2_SR register.

Bit 9 EOC2: End of conversion of ADC2
     This bit is a copy of the EOC bit in the ADC2_SR register.

Bit 8 AWD2: Analog watchdog flag of ADC2
     This bit is a copy of the AWD bit in the ADC2_SR register.

Bits 7:6 Reserved, must be kept at reset value.

Bit 5 OVR1: Overrun flag of ADC1
     This bit is a copy of the OVR bit in the ADC1_SR register.

Bit 4 STRT1: Regular channel Start flag of ADC1
     This bit is a copy of the STRT bit in the ADC1_SR register.

Bit 3 JSTRT1: Injected channel Start flag of ADC1
     This bit is a copy of the JSTRT bit in the ADC1_SR register.

Bit 2 JEOC1: Injected channel end of conversion of ADC1
     This bit is a copy of the JEOC bit in the ADC1_SR register.

Bit 1 EOC1: End of conversion of ADC1
     This bit is a copy of the EOC bit in the ADC1_SR register.

Bit 0 AWD1: Analog watchdog flag of ADC1
     This bit is a copy of the AWD bit in the ADC1_SR register.

tha

15.13.16 ADC common control register (ADC_CCR)

Address offset: 0x04 (offset address นี้สัมพันธ์กับ ADC1 base address + 0x300)
Reset value: 0x0000 0000



Bits 31:24 Reserved, must be kept at reset value.

Bit 23 TSVREFE: Temperature sensor and VREFINT enable
     บิตนี้ถูกเซ็ตและเคลียร์โดย software เพื่อเปิดใช้งาน/ปิดใช้งาน the temperature sensor และ the VREFINT channel.
     0: Temperature sensor and VREFINT channel ถูกปิดใช้งาน
     1: Temperature sensor and VREFINT channel ถูกเปิดใช้งาน
   Note: VBATE ต้องถูกปิดใช้งานเมื่อ TSVREFE ถูกเซ็ต. ถ้าทั้งสอง bits ถูกเซ็ต, มีเพียง the VBAT conversion ที่ถูกทำ.

Bit 22 VBATE: VBAT enable
     บิตนี้ถูกเซ็ตและเคลียร์โดย software เพื่อเปิดใช้งาน/ปิดใช้งาน the VBAT channel.
     0: VBAT channel ถูกปิดใช้งาน
     1: VBAT channel ถูกเปิดใช้งาน

Bits 21:18 Reserved, must be kept at reset value.

Bits 17:16 ADCPRE: ADC prescaler
     ถูกเซ็ตและเคลียร์โดย software เพื่อเลือก the frequency ของ the clock ไปยัง the ADC. The clock ใช้ร่วมกันสำหรับทุก the
     ADCs.
     Note: 00: PCLK2 ถูกหารด้วย 2
               01: PCLK2 divided by 4
               10: PCLK2 divided by 6
               11: PCLK2 divided by 8

Bits 15:14 DMA: Direct memory access mode for multi ADC mode
     bit-field นี้ถูกเซ็ตและเคลียร์โดย software. อ้างอิงถึง the DMA controller section สำหรับรายละเอียดที่มากขึ้น.
     00: DMA mode ถูกปิดการใช้งาน
     01: DMA mode 1 enabled (2 / 3 half-words ที่ละหนึ่ง - 1 จากนั้น 2 จากนั้น 3)
     10: DMA mode 2 enabled (2 / 3 half-words ทีละคู่ - 2&1 จากนั้น 1&3 จากนั้น 3&2)
     11: DMA mode 3 enabled (2 / 3 bytes ทีละคู่ - 2&1 จากนั้น 1&3 จากนั้น 3&2)

Bit 13 DDS: DMA disable selection (for multi-ADC mode)
     บิตนี้ถูกเซ็ตและเคลียร์โดย software.
     0: ไม่มี new DMA request ถูกปล่อยออกหลังจาก the last transfer (ตามที่กำหนดค่าใน the DMA controller). DMA bits ไม่
          ถูกเคลียร์โดย hardware, อย่างไรก็ตามพวกมันต้องถูกเคลียร์แล้วและเซ็ตเป็นโหมดที่ต้องการโดย software ก่อน new DMA
          requests สามารถถูกสร้าง.
     1: DMA requests ถูกปล่อยออกตราบใดที่ data ถูกแปลงและ DMA = 01, 10 or 11.

Bit 12 Reserved, must be kept at reset value.

tha

Bits 11:8 DELAY: Delay between 2 sampling phases
     ถูกเซ็ตและเคลียร์โดย software. บิตเหล่านี้ถูกใช้ใน dual or triple interleaved modes.
     0000: 5 * TADCCLK
     0001: 6 * TADCCLK
     0010: 7 * TADCCLK
     ...
     1111: 20 * TADCCLK

Bits 7:5 Reserved, must be kept at reset value.

Bits 4:0 MULTI[4:0]: Multi ADC mode selection
     บิตเหล่านี้ถูกเขียนโดย software เพื่อเลือก the operating mode.
  – ทุก the ADCs เป็นอิสระ:
     00000: Independent mode
  – 00001 ถึง 01001: Dual mode, ADC1 and ADC2 ทำงานร่วมกัน, ADC3 เป็นอิสระ
     00001: Combined regular simultaneous + injected simultaneous mode
     00010: Combined regular simultaneous + alternate trigger mode
     00011: Reserved
     00101: Injected simultaneous mode only
     00110: Regular simultaneous mode only
     00111: interleaved mode only
     01001: Alternate trigger mode only
  – 10001 ถึง 11001: Triple mode: ADC1, 2 and 3 ทำงานร่วมกัน
     10001: Combined regular simultaneous + injected simultaneous mode
     10010: Combined regular simultaneous + alternate trigger mode
     10011: Reserved
     10101: Injected simultaneous mode only
     10110: Regular simultaneous mode only
     10111: interleaved mode only
     11001: Alternate trigger mode only
     ชุดค่าผสมอื่น ๆ ทั้งหมดถูกสงวนไว้และต้องไม่ถูกโปรแกรมไว้
     Note: In multi mode, การเปลี่ยน channel configuration จะสร้าง an abort ที่สามารถเป็นเหตให้เกิด a loss of
               synchronization. ขอแนะนำให้ปิดใช้งาน the multi ADC mode ก่อนการเปลี่ยนการกำหนดค่าใดๆ.