Hi, Using 6711. I have EDMA synchronized to EXT_INT4. During transfer complete ISR, due to some hardware testing I am receiving some false external interrupts which I do not want EDMA to pick it up. To fix this problem, I am using following sequence: EDMA_disableChannel(hEdmaCha4); EDMA_clearChannel(hEdmaCha4); EDMA_enableChannel(hEdmaCha4); But after using this sequence EDMA simply stops working and does not respond to next external interrupts. Here is part of the code: MAIN.C #include "sw6711_adccfg.h" #include "sw6x100.h" #include "sw6x_dds.h" #include "regs.h" #include <stdio.h> #include <std.h> #include <csl.h> #include <csl_timer.h> #include <csl_cache.h> #include <csl_edma.h> #include <csl_irq.h> #include <csl_dat.h> #include <prd.h> #include <trc.h> #include <log.h> #define EMIF_CE2 0x1800010 #define FRAMES 250 #define FRMSIZE 1024 #define DATASIZE1 FRAMES*FRMSIZE #pragma DATA_ALIGN (adctemp, 2048); // globals unsigned int *adctemp; void edmaIsr() { EDMA_intClear(8); EDMA_disableChannel(hEdmaCha4); EDMA_clearChannel(hEdmaCha4); // EDMA_RSET(ECR,0x10); if(i<FRAMES) { EDMA_RSETH(hEdmaCha4, DST, &adctemp[FRMSIZE*i++]); } else { IRQ_reset(IRQ_EVT_EDMAINT); EDMA_disableChannel(hEdmaCha4); } EDMA_enableChannel(hEdmaCha4); } void main(void) { // Initialize Board adctemp = (void *)malloc(DATASIZE1*sizeof(unsigned int)); if(adctemp == NULL) { while(1); } SW6x_Init(); IRQ_reset(IRQ_EVT_EDMAINT); EDMA_intDisable(8); EDMA_intClear(8); EDMA_clearPram(0x00000000); edmaCfg0.src = (0x220000+DSKOFFSET); edmaCfg0.cnt = FRMSIZE; edmaCfg0.rld = EDMA_RLD_RMK(0,hEdmaTbl0); EDMA_config(hEdmaTbl0, &edmaCfg0); EDMA_config(hEdmaCha4, &edmaCfg0); REG_WRITE (EMIF_CE2, 0x00610320); // CE2 control, 32bit async *UART_DIOA_CTRL_Reg = 0x100; *DAC_DIOB_CTRL_Reg = 0x0000; { *ADC_Ctrl = 0x000C; *ADC_Ctrl = 0x0800; *ADC_Ctrl = 0x0801; } /* Enable the related interrupts */ IRQ_enable(IRQ_EVT_EDMAINT); EDMA_intEnable(8); EDMA_enableChannel(hEdmaCha4); // fall into BIOS loop... } ====================================================================== ====================================================================== ====================================================================== /* Do *not* directly modify this file. It was */ /* generated by the Configuration Tool; any */ /* changes risk being overwritten. */ /* INPUT sw6711_adc.cdb */ /* Include Header File */ #include "sw6711_adccfg.h" extern far int adctemp[]; /* Config Structures */ EDMA_Config edmaCfg0 = { 0x20380003, /* Option */ 0xA0220000, /* Source Address - Numeric */ 0x00000400, /* Transfer Counter - Numeric */ (Uint32) adctemp, 0x00000004, /* Index register - Numeric */ 0x000001B0 /* Element Count Reload and Link Address */ }; /* Handles */ EDMA_Handle hEdmaCha4; EDMA_Handle hEdmaTbl0; /* * ======== CSL_cfgInit() ======== */ void CSL_cfgInit() { hEdmaCha4 = EDMA_open(EDMA_CHA_EXTINT4, EDMA_OPEN_RESET); hEdmaTbl0 = EDMA_allocTable(-1); } |
Question about EDMA
Started by ●February 25, 2005