Direct Memory Access Multiplexer (DMAMUX)
In File main.c:
#include "registers.h"
*CHCFG1 = 0x00;
*CHCFG1 = 0xC5;
To enable a source without periodic triggering:
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.
Select the source to be routed to the DMA channel. Write to the corresponding CHCFG
register, ensuring that CHCFG[ENBL] is set while CHCFG[TRIG] is cleared.
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 no periodic triggering
capability:
1.
Write 0x00 to CHCFG1 (base address + 0x01).
2.
Configure channel 1 in the DMA, including enabling the channel.
3.
Write 0x85 to CHCFG1 (base address + 0x01).
The following code example illustrates steps 1 and 3 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);
458/2058
:
:
DocID027809 Rev 4
0xFC084000/* Example only ! */
RM0400
Need help?
Do you have a question about the SPC572L series and is the answer not in the manual?