DMA MUX on MK02FN128VFM10

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMA MUX on MK02FN128VFM10

Jump to solution
618 Views
bloatedwarthog
Contributor I

I have been working on getting Example 7.1.5 from this document:  http://cache.freescale.com/files/32bit/doc/quick_ref_guide/KQRUG.pdf  working on our MK02.

I have the PIT configured and working, but whenever I try to reference the DMA MUX registers for either read or write operations, I get a hard fault. The register I'm trying to access is DMAMUX_CHCFG0 at address 0x40021000.

Reading section 21.3 of this manual:  http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K02P64M100SFARM.pdf  says that the address is at the location I'm trying to access. I'm a little confused why even trying to access the location causes a hard fault.  In any case, I'm wondering if you could ask around and find out if anyone has this sample running on the MK02. I want to do exactly what the sample does which is read the ADC at a particular frequency and DMA the results to a block of memory.

The code I'm using is literally as simple as:

     uint8_t test = DMAMUX_CHCFG0;

    LOG_DEBUG1("DMAMUX_CHCFG0: %x\n", test);

I've also looked at the definitions from the mac7100.h file used by Keil. That defines the config register as DMAMUX_CHCONFIG0 at address 0xFC084000. This doesn't match the hardware docs I have so I assume it is referencing a different chip. Just for fun I tried accessing the register but got the same result.

Anyway, thanks in advance for any clues you can provide.

Labels (1)
Tags (2)
0 Kudos
1 Solution
423 Views
EarlOrlando
Senior Contributor II

Hello,

Is the clock gating for the DMAMUX enabled? Please be sure that the field DMAMUX in the register SIM_SCGC6 is enabled before to write/read in the DMAMUX_CHCFGn register.

Best regards,

Earl.

View solution in original post

2 Replies
424 Views
EarlOrlando
Senior Contributor II

Hello,

Is the clock gating for the DMAMUX enabled? Please be sure that the field DMAMUX in the register SIM_SCGC6 is enabled before to write/read in the DMAMUX_CHCFGn register.

Best regards,

Earl.

423 Views
bloatedwarthog
Contributor I

Thanks Earl. That was it. For everyone else, here's the working snippet:

SIM_WR_SCGC6_DMAMUX(SIM, 1);

uint8_t test = DMAMUX_CHCFG0;

LOG_DEBUG1("DMAMUX_CHCFG0: %x\n", test);

0 Kudos