9
ARM Processors / Re: STM32F7 22 Advanced-control timers (TIM1/TIM8)
« on: January 31, 2023, 05:33:36 am »
22.4.19 TIMx DMA control register (TIMx_DCR)( x = 1, 8 )
Address offset: 0x48
Reset value: 0x0000

Bits 15:13 Reserved, must be kept at reset value.
Bits 12:8 DBL[4:0]: DMA burst length
5-bit vector นี้กำหนดความยาวของ DMA transfers (the timer รับรู้ a burst transfer เมื่อ a read or a write access ถูกทำ
ไปยัง the TIMx_DMAR address), เช่น จำนวนของ transfers. Transfers สามารถเป็นใน half-words หรือใน bytes (ดูตัวอย่าง
ข้างล่าง).
00000: 1 transfer
00001: 2 transfers
00010: 3 transfers
...
10001: 18 transfers
Example: ให้เราพิจารณาการส่งถ่ายต่อไปนี้: DBL = 7 bytes และ DBA = TIM2_CR1.
– ถ้า DBL = 7 bytes และ DBA = TIM2_CR1 แสดง the address ของ the byte ที่จะถูกส่งถ่าย, the address ของ the
transfer ควรถูกให้โดยสมการต่อไปนี้:
(TIMx_CR1 address) + DBA + (DMA index), โดยที่ DMA index = DBL
ในตัวอย่างนี้, 7 bytes ถูกเพิ่มให้กับ (TIMx_CR1 address) + DBA, ซึ่งให้เร the address จาก/ถึง ซึ่ง the data จะถูกคัดลอก.
ในกรณีนี้, the transfer จะถูกทำไปยัง 7 registers สตารทจาก the following address: (TIMx_CR1 address) + DBA
สอดคล้องกับการกำหนดค่าของ the DMA Data Size, หลายกรณีอาจเกิดขึ้น:
– ถ้าคุณกำหนดค่า the DMA Data Size ใน half-words, 16-bit data จะถูกส่งถ่ายไปยังแต่ละของ the 7 registers.
– ถ้าคุณกำหนดค่า the DMA Data Size ใน bytes, the data จะถูกส่งถ่ายไปยัง 7 registers ด้วย: the first register จะบรรจุ
the first MSB byte, the second register, the first LSB byte และต่อไป. ดังนั้นด้วย the transfer Timer, คุณจำเป็นต้อง
ระบุขนาดของ data ที่ส่งถ่ายโดย DMA.
Bits 7:5 Reserved, must be kept at reset value.
Bits 4:0 DBA[4:0]: DMA base address
5-bits vector นี้กำหนด the base-address สำหรับ DMA transfers (เมื่อ read/write access ถูกทำผ่านทาง the
TIMx_DMAR address). DBA ถูกกำหนดเป็น an offset(ระยะที่ห่าง) ที่สตารทจาก the address of the TIMx_CR1 register.
Example:
00000: TIMx_CR1,
00001: TIMx_CR2,
00010: TIMx_SMCR,
Address offset: 0x48
Reset value: 0x0000

Bits 15:13 Reserved, must be kept at reset value.
Bits 12:8 DBL[4:0]: DMA burst length
5-bit vector นี้กำหนดความยาวของ DMA transfers (the timer รับรู้ a burst transfer เมื่อ a read or a write access ถูกทำ
ไปยัง the TIMx_DMAR address), เช่น จำนวนของ transfers. Transfers สามารถเป็นใน half-words หรือใน bytes (ดูตัวอย่าง
ข้างล่าง).
00000: 1 transfer
00001: 2 transfers
00010: 3 transfers
...
10001: 18 transfers
Example: ให้เราพิจารณาการส่งถ่ายต่อไปนี้: DBL = 7 bytes และ DBA = TIM2_CR1.
– ถ้า DBL = 7 bytes และ DBA = TIM2_CR1 แสดง the address ของ the byte ที่จะถูกส่งถ่าย, the address ของ the
transfer ควรถูกให้โดยสมการต่อไปนี้:
(TIMx_CR1 address) + DBA + (DMA index), โดยที่ DMA index = DBL
ในตัวอย่างนี้, 7 bytes ถูกเพิ่มให้กับ (TIMx_CR1 address) + DBA, ซึ่งให้เร the address จาก/ถึง ซึ่ง the data จะถูกคัดลอก.
ในกรณีนี้, the transfer จะถูกทำไปยัง 7 registers สตารทจาก the following address: (TIMx_CR1 address) + DBA
สอดคล้องกับการกำหนดค่าของ the DMA Data Size, หลายกรณีอาจเกิดขึ้น:
– ถ้าคุณกำหนดค่า the DMA Data Size ใน half-words, 16-bit data จะถูกส่งถ่ายไปยังแต่ละของ the 7 registers.
– ถ้าคุณกำหนดค่า the DMA Data Size ใน bytes, the data จะถูกส่งถ่ายไปยัง 7 registers ด้วย: the first register จะบรรจุ
the first MSB byte, the second register, the first LSB byte และต่อไป. ดังนั้นด้วย the transfer Timer, คุณจำเป็นต้อง
ระบุขนาดของ data ที่ส่งถ่ายโดย DMA.
Bits 7:5 Reserved, must be kept at reset value.
Bits 4:0 DBA[4:0]: DMA base address
5-bits vector นี้กำหนด the base-address สำหรับ DMA transfers (เมื่อ read/write access ถูกทำผ่านทาง the
TIMx_DMAR address). DBA ถูกกำหนดเป็น an offset(ระยะที่ห่าง) ที่สตารทจาก the address of the TIMx_CR1 register.
Example:
00000: TIMx_CR1,
00001: TIMx_CR2,
00010: TIMx_SMCR,