STM32F1 ADC HAL

Started by tha, September 17, 2020, 09:42:20 AM

Previous topic - Next topic

tha



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]: fourth conversion in injected sequence (เมื่อ JL[1:0] = 3)           (1)
บิตเหล่านี้ถูกเขียนโดย software ด้วย the channel number (0..17) ระบุเป็นลำดับที่ the fourth ใน the sequence ที่ถูกแปลง.

Note: ไม่เหมือน a regular conversion sequence, ถ้า JL[1:0] length น้อยกว่า 4, the channels ถูกแปลงใน a sequence  สตาร์ทจาก (4-JL). ตัวอย่าง: ADC_JSQR[21:0] = 10
00011 00011 00111 00010 หมายความว่า a scan conversion จะแปลงลำดับชาแนลดังต่อไปนี้ : 7, 3, 3. (ไม่ใช่ 2, 7, 3)

Bits 14:10 JSQ3[4:0]: third conversion in injected sequence (when JL[1:0] = 3)
Bits 9:5 JSQ2[4:0]: second conversion in injected sequence (when JL[1:0] = 3)
Bits 4:0 JSQ1[4:0]: first conversion in injected sequence (when JL[1:0] = 3)

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

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

เมื่อ JL=1 ( 2 injected conversions ใน the sequencer), the ADC แปลง the channels ตามลำดับนี้:
JSQ3[4:0] >> JSQ4[4:0]

เมื่อ JL=0 (1 injected conversion ใน the sequencer), the ADC แปลงเพียง JSQ4[4:0] channel

tha



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 27 และ Figure 28.

tha



Bits 31:16 ADC2DATA[15:0]: ADC2 data
ใน ADC1: ใน dual mode, บิตเหล่านี้บรรจุ the regular data ของ ADC2. อ้างอิงถึง Section 11.9: Dual ADC mode.
ใน ADC2 และ ADC3: บิตเหล่านี้ไม่ได้ถูกใช้.

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


tha