STMicroelectronics SPC572L series Reference Manual page 457

Table of Contents

Advertisement

RM0400
1.
Determine with which DMA channel the source will be associated. Note that only the
first DMA channels have periodic triggering capability.
2.
Clear the CHCFG[ENBL] and CHCFG[TRIG] fields of the DMA channel.
3.
Ensure that the DMA channel is properly configured in the DMA. The DMA channel
may be enabled at this point.
4.
Configure the corresponding timer.
5.
Select the source to be routed to the DMA channel. Write to the corresponding CHCFG
register, ensuring that the CHCFG[ENBL] and CHCFG[TRIG] fields are set.
Note:
The following is an example. See the chip configuration details for the number of this
device's DMA channels that have triggering capability.
To configure source #5 transmit for use with DMA channel 1, with periodic triggering
capability:
1.
Write 0x00 to CHCFG1 (base address + 0x01).
2.
Configure channel 1 in the DMA, including enabling the channel.
3.
Configure a timer for the desired trigger interval.
4.
Write 0xC5 to CHCFG1 (base address + 0x01).
The following code example illustrates steps 1 and 4 above:
In File registers.h:
#define DMAMUX_BASE_ADDR
/* Following example assumes char is 8-bits */
volatile unsigned char *CHCFG0 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0000);
volatile unsigned char *CHCFG1 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0001);
volatile unsigned char *CHCFG2 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0002);
volatile unsigned char *CHCFG3 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0003);
volatile unsigned char *CHCFG4 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0004);
volatile unsigned char *CHCFG5 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0005);
volatile unsigned char *CHCFG6 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0006);
volatile unsigned char *CHCFG7 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0007);
volatile unsigned char *CHCFG8 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0008);
volatile unsigned char *CHCFG9 = (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x0009);
volatile unsigned char *CHCFG10= (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x000A);
volatile unsigned char *CHCFG11= (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x000B);
volatile unsigned char *CHCFG12= (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x000C);
volatile unsigned char *CHCFG13= (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x000D);
volatile unsigned char *CHCFG14= (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x000E);
volatile unsigned char *CHCFG15= (volatile unsigned char *)
(DMAMUX_BASE_ADDR+0x000F);
Direct Memory Access Multiplexer (DMAMUX)
0xFC084000/* Example only ! */
DocID027809 Rev 4
457/2058
460

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SPC572L series and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents