STM32F7 15 Analog-to-digital converter (ADC)

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

Previous topic - Next topic

tha

Dual ADC mode

ที่ the end of conversion event บน ADC1 or ADC2:
•   A 32-bit DMA transfer request ถูกสร้าง (ถ้า DMA[1:0] bits ใน the ADC_CCR register เท่ากับ 0b10). การร้องขอนี้จะส่ง
     ถ่าย the ADC2 converted data ที่เก็บใน the upper half-word อขง the ADC_CDR 32-bit register ไปยัง the SRAM และ
     จากนั้น the ADC1 converted data ที่เก็บใน the lower half-word ของ ADC_CCR ไปยัง the SRAM.
•   A EOC interrupt ถูกสร้าง (ถ้าเปิดใช้งานบนอันใดอันหนึ่งจาก the two ADC interfaces) เมื่อ the ADC1/ADC2's regular
     channels ถูกแปลงแล้วทั้งหมด.


tha

Triple ADC mode

ที่ the end of conversion event บน ADC1, ADC2 or ADC3:
•   Three 32-bit DMA transfer requests ถูกสร้าง (ถ้า DMA[1:0] bits ใน the ADC_CCR register เท่ากับ 0b01). Three
     transfers ดังนั้นแทนที่จาก the ADC_CDR 32-bit register ไปยัง SRAM: first the ADC1 converted data, จากนั้น the
     ADC2 converted data และสุดท้าย the ADC3 converted data. The process ถูกทำซ้ำสำหรับแต่ละ new three
     conversions.
•   A EOC interrupt ถูกสร้าง (ถ้าเปิดใช้งานบนอันใดอันหนึ่งจาก the three ADC interfaces) เมื่อ the ADC1/ADC2/ADC3's
     regular channels ถูกแปลงแล้วทั้งหมด.


tha

15.9.3 Interleaved mode

โหมดนี้สามารถถูกสตาร์ทเฉพาะบน a regular group (โดยปกติ one channel). The external trigger source มาจาก the regular channel multiplexer of ADC1.

Dual ADC mode

หลังจาก an external trigger เกิดขึ้น:
•   ADC1 สตาร์ททันที
•   ADC2 สตาร์ทหลังจากการหน่วงเวลาของหลาย ADC clock cycles

The minimum delay ซึ่งแยก 2 conversions ใน interleaved mode ถูกกำหนดค่าใน the DELAY bits ใน the ADC_CCR register. อย่างไรก็ตาม, an ADC ไม่สามารถสตาร์ท a conversion ได้ถ้า the complementary ADC ยังคงกำลังสุ่มอินพุทของมัน (มีเพียงหนึ่ง ADC เท่านั้นที่สามารถสุ่ม the input signal ที่เวลาที่กำหนด). ในกรณีนี้, the delay จะกลายเป็น the sampling time + 2 ADC clock cycles. ตัวอย่างเช่น, ถ้า DELAY = 5 clock cycles และ the sampling ใช้เวลา 15 clock cycles บนทั้งสอง ADCs, ดังนั้น 17 clock cycles จะแยก conversions บน ADC1 และ ADC2).

ถ้า the CONT bit ถูกเซ็ตบนทั้ง ADC1 and ADC2, the selected regular channels ของทั้งสอง ADCs จะถูกแปลงอย่างต่อเนื่องไป.

Note: ถ้า the conversion sequence ถูกอินเตอร์รัพท์ (ตัวอย่างเช่นเมื่อ DMA end of transfer เกิดขึ้น), the multi-ADC
         sequencer ต้องถูกรีเซ็ตโดยการกำหนดค่ามันใน independent mode ก่อน (bits DUAL[4:0] = 00000) ก่อนที่จะโปรแกรม
         ใหม่เป็น the interleaved mode.


หลังจาก an EOC interrupt ถูกสร้างโดย ADC2 (ถ้าถูกเปิดใช้งานผ่านทาง the EOCIE bit) a 32-bit DMA transfer request จะถูกสร้าง (ถ้า the DMA[1:0] bits ใน ADC_CCR เท่ากับ 0b10). request จะส่งถ่าย the ADC2 converted data ที่เก็บใน the upper half-word ของ the ADC_CDR 32-bit register ลงใน SRAM ก่อน, จากนั้น the ADC1 converted data ที่เก็บใน the register's lower half-word ลงใน SRAM.



tha

Triple ADC mode

หลังจาก an external trigger เกิดขึ้น:
•   ADC1 สตาร์ททันทีและ
•   ADC2 สตาร์ทหลังจากการหน่วงเวลาของหลาย ADC clock cycles
•   ADC3 สตาร์ทหลังจากการหน่วงเวลาของหลาย ADC clock cycles ที่อ้างอิงจาก the ADC2 conversion

The minimum delay ซึ่งแยก 2 conversions ใน interleaved mode ถูกกำหนดค่าใน the DELAY bits ใน the ADC_CCR register. อย่างไรก็ตาม, an ADC ไม่สามารถสตาร์ท a conversion ได้ถ้า the complementary ADC ยังคงกำลังสุ่มอินพุทของมัน (มีเพียงหนึ่ง ADC เท่านั้นที่สามารถสุ่ม the input signal ที่เวลาที่กำหนด). ในกรณีนี้, the delay จะกลายเป็น the sampling time + 2 ADC clock cycles. ตัวอย่างเช่น, ถ้า DELAY = 5 clock cycles และ the sampling ใช้เวลา 15 clock cycles บน the three ADCs, ดังนั้น 17 clock cycles จะแยก conversions บน ADC1, ADC2 and ADC3).

ถ้า the CONT bit ถูกเซ็ตบนทั้ง ADC1, ADC2 and ADC3, the selected regular channels ของทุก ADCs จะถูกแปลงอย่างต่อเนื่องไป.

Note: ถ้า the conversion sequence ถูกอินเตอร์รัพท์ (ตัวอย่างเช่นเมื่อ DMA end of transfer เกิดขึ้น), the multi-ADC
         sequencer ต้องถูกรีเซ็ตโดยการกำหนดค่ามันใน independent mode ก่อน (bits DUAL[4:0] = 00000) ก่อนที่จะโปรแกรม
         ใหม่เป็น the interleaved mode.


ในโหมดนี้ a DMA request ถูกสร้างแต่ละครั้งที่ 2 data items มีให้ใช้งาน, (ถ้า the DMA[1:0] bits ใน the ADC_CCR register เท่ากับ 0b10). The request ก่อนอื่นจะส่งถ่าย the first converted data ที่เก็บใน the lower half-word ของ the ADC_CDR 32-bit register ไปยัง SRAM, จากนั้นมันจะส่งถ่าย the second converted data ที่เก็บใน ADC_CDR's upper half-word to SRAM.

ลำดับเป็นดังต่อไปนี้ :
•   1st request: ADC_CDR[31:0] = ADC2_DR[15:0] | ADC1_DR[15:0]
•   2nd request: ADC_CDR[31:0] = ADC1_DR[15:0] | ADC3_DR[15:0]
•   3rd request: ADC_CDR[31:0] = ADC3_DR[15:0] | ADC2_DR[15:0]
•   4th request: ADC_CDR[31:0] = ADC2_DR[15:0] | ADC1_DR[15:0], ...


tha

15.9.4 Alternate trigger mode

โหมดนี้สามารถถูกสตาร์ทเฉพาะบน an injected group. The source of external trigger มาจาก the injected group multiplexer of ADC1

Note: Regular conversions สามารถถูกเปิดใช้งานบน ADCs หนึ่งหรือทั้งหมด. ในกรณีนี้ the regular conversions เป็นอิสระจากกัน.
          A regular conversion ถูกอินเตอร์รัพท์เมื่อ the ADC ต้องกระทำ an injected conversion. มันจะกลับมาทำงานต่อเมื่อ the
          injected conversion สำเร็จ.

          ถ้า the conversion sequence ถูกอินเตอร์รัพท์ (ตัวอย่างเช่นเมื่อ DMA end of transfer เกิดขึ้น), the multi-ADC
          sequencer ต้องถูกรีเซ็ตโดยการกำหนดค่ามันใน independent mode ก่อน (bits DUAL[4:0] = 00000) ก่อนที่จะโปรแกรม
          ใหม่เป็น the interleaved mode.

          The time interval ระหว่าง 2 trigger events ต้องมากกว่าหรือเท่ากับ 1 ADC clock period. The minimum time
          interval ระหว่าง 2 trigger events ที่สตาร์ท conversions บน the same ADC เป็นอย่างเดียวกันกับใน the single ADC
          mode.

tha

Dual ADC mode

•   เมื่อ the 1st trigger เกิดขึ้น, ทุก injected ADC1 channels ใน the group ถูกแปลง
•   เมื่อ the 2nd trigger เกิดขึ้น, ทุก injected ADC2 channels ใน the group ถูกแปลง
•   และต่อไป

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC1 channels ใน the group ถูกแปลงแล้ว.

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC2 channels ใน the group ถูกแปลงแล้ว.

ถ้า external trigger อื่นอีกตัวหนึ่งเกิดขึ้นหลังจากทุก injected channels ใน the group ถูกแปลงแล้วจากนั้น the alternate trigger process จะสตาร์ทใหม่โดยการแปลง the injected ADC1 channels ใน the group.


ถ้า the injected discontinuous mode ถูกเปิดใช้งานสำหรับทั้ง ADC1 and ADC2:
•   เมื่อ the 1st trigger เกิดขึ้น, the first injected ADC1 channel ถูกแปลง.
•   เมื่อ the 2nd trigger เกิดขึ้น, the first injected ADC2 channel ถูกแปลง.
•   และต่อไป

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC1 channels ใน the group ถูกแปลงแล้ว.

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC2 channels ใน the group ถูกแปลงแล้ว.

ถ้า external trigger อื่นอีกตัวหนึ่งเกิดขึ้นหลังจากทุก injected channels ใน the group ถูกแปลงแล้วจากนั้น the alternate trigger process จะสตาร์ทใหม่.

tha

Triple ADC mode

•   เมื่อ the 1st trigger เกิดขึ้น, ทุก injected ADC1 channels ใน the group ถูกแปลง
•   เมื่อ the 2nd trigger เกิดขึ้น, ทุก injected ADC2 channels ใน the group ถูกแปลง
•   เมื่อ the 3rd trigger เกิดขึ้น, ทุก injected ADC3 channels ใน the group ถูกแปลง
•   และต่อไป

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC1 channels ใน the group ถูกแปลงแล้ว.

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC2 channels ใน the group ถูกแปลงแล้ว.

A JEOC interrupt, ถ้าเปิดใช้งาน, ถูกสร้างหลังจากทุก injected ADC3 channels ใน the group ถูกแปลงแล้ว.

ถ้า external trigger อื่นอีกตัวหนึ่งเกิดขึ้นหลังจากทุก injected channels ใน the group ถูกแปลงแล้วจากนั้น the alternate trigger process จะสตาร์ทใหม่โดยการแปลง the injected ADC1 channels ใน the group.

tha

15.9.6 Combined regular simultaneous + alternate trigger mode

มันเป็นไปได้ที่จะอินเตอร์รัพท์ the simultaneous conversion of a regular group เพื่อสตาร์ท the alternate trigger conversion of an injected group. Figure 90 แสดงพฤติกรรมของ an alternate trigger อินเตอร์รัพท์  a simultaneous regular conversion.

The injected alternate conversion ถูกสตาร์ททันทีหลังจาก the injected event. ถ้า regular conversion กำลังรันอยู่แล้ว, เพื่อให้แน่ใจว่า synchronization หลังจาก the injected conversion, the regular conversion ของทุก (master/slave) ADCs จะถูกหยุดและกลับมาทำงานต่ออย่างซิงโครไนส์ที่ the end of the injected conversion.

Note: ใน combined regular simultaneous + alternate trigger mode, ตัวหนึ่งต้องแปลง sequences ที่มีความยาวเท่ากันหรือ
          ทำให้แน่ใจว่าช่วงเวลาระหว่าง triggers นานกว่า the long conversion time ของ the 2 sequences (Dual ADC mode) /3
          sequences (Triple ADC mode). มิฉะนั้น, the ADC ที่มี the shortest sequence อาจสตาร์ทซ้ำในขณะที่ the ADC ที่มี
          the longest sequence กำลังเสร็จสมบูรณ์ the previous conversions.

          ถ้า the conversion sequence ถูกอินเตอร์รัพท์ (ตัวอย่างเช่นเมื่อ DMA end of transfer เกิดขึ้น), the multi-ADC
          sequencer ต้องถูกรีเซ็ตโดยการกำหนดค่ามันใน independent mode ก่อน (bits DUAL[4:0] = 00000) ก่อนที่จะโปรแกรม
          ใหม่เป็น the interleaved mode.



ถ้า a trigger เกิดขึ้นในระหว่าง an injected conversion ที่อินเตอร์รัพท์ a regular conversion แล้ว, มันจะถูกเพิกเฉย. Figure 91 แสดง the behavior ในกรณีนี้ (2nd trigger ถูกเพิกเฉย).