![NXP Semiconductors SAFE ASSURE Qorivva MPC5601P Reference Manual Download Page 434](http://html.mh-extra.com/html/nxp-semiconductors/safe-assure-qorivva-mpc5601p/safe-assure-qorivva-mpc5601p_reference-manual_1721898434.webp)
Chapter 19 DMA Channel Mux (DMA_MUX)
MPC5602P Microcontroller Reference Manual, Rev. 4
434
Freescale Semiconductor
3. Ensure that the DMA channel is properly configured in the DMA. The DMA channel may be
enabled at this point.
4. In the PIT, configure the corresponding timer.
5. Select the source to be routed to the DMA channel. Write to the corresponding CHCONFIG
register, ensuring that the ENBL and TRIG bits are set.
Example 19-1. Configure source #5 Transmit for use with DMA channel 2, with periodic triggering capability
1. Write 0x00 to CHCONFIG2 (Base A 0x02).
2. Configure Channel 2 in the DMA, including enabling the channel.
3. Configure Timer 3 in the Periodic Interrupt Timer (PIT) for the desired trigger interval.
4. Write 0xC5 to CHCONFIG2 (Base A 0x02).
The following code example illustrates steps 1 and 4 above:
In File
registers.h:
#define DMAMUX_BASE_ADDR 0xFC084000/* Example only ! */
/* Following example assumes char is 8-bits */
volatile unsigned char *CHCONFIG0 = (volatile unsigned char *) (DMAMUX_BA0x0000);
volatile unsigned char *CHCONFIG1 = (volatile unsigned char *) (DMAMUX_BA0x0001);
volatile unsigned char *CHCONFIG2 = (volatile unsigned char *) (DMAMUX_BA0x0002);
volatile unsigned char *CHCONFIG3 = (volatile unsigned char *) (DMAMUX_BA0x0003);
volatile unsigned char *CHCONFIG4 = (volatile unsigned char *) (DMAMUX_BA0x0004);
volatile unsigned char *CHCONFIG5 = (volatile unsigned char *) (DMAMUX_BA0x0005);
volatile unsigned char *CHCONFIG6 = (volatile unsigned char *) (DMAMUX_BA0x0006);
volatile unsigned char *CHCONFIG7 = (volatile unsigned char *) (DMAMUX_BA0x0007);
volatile unsigned char *CHCONFIG8 = (volatile unsigned char *) (DMAMUX_BA0x0008);
volatile unsigned char *CHCONFIG9 = (volatile unsigned char *) (DMAMUX_BA0x0009);
volatile unsigned char *CHCONFIG10= (volatile unsigned char *) (DMAMUX_BA0x000A);
volatile unsigned char *CHCONFIG11= (volatile unsigned char *) (DMAMUX_BA0x000B);
volatile unsigned char *CHCONFIG12= (volatile unsigned char *) (DMAMUX_BA0x000C);
volatile unsigned char *CHCONFIG13= (volatile unsigned char *) (DMAMUX_BA0x000D);
volatile unsigned char *CHCONFIG14= (volatile unsigned char *) (DMAMUX_BA0x000E);
volatile unsigned char *CHCONFIG15= (volatile unsigned char *) (DMAMUX_BA0x000F);
In File
main.c:
#include "registers.h"
:
:
*CHCONFIG2 = 0x00;
*CHCONFIG2 = 0xC5;
Enabling a source without periodic triggering:
1. Determine with which DMA channel the source will be associated. Remember that only DMA
channels 0–7 have periodic triggering capability.
2. Clear the ENBL and TRIG bits 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 CHCONFIG
register, ensuring that the ENBL is set and the TRIG bit is cleared.