Part Number: TMS320F28375D
Tool/software: Code Composer Studio
Please tell me about EMIF1MSEL change during interrupt processing.
[environment]
・ TMS320F28375D
・ CCS8.1.0.00011
The following EMIF code is created in a dual environment.
/ ************************************************* *********************************** /
void emif1 (uint16_t * u16Mod, uint16_t * u16Src)
{
uint32_t t = 0;
while (1) {
EALLOW;
t = Emif1ConfigRegs.EMIF1MSEL.all;
EDIS;
if (t == 0) {// EMIF1 no Grab
break;
}
}
EALLOW;
Emif1ConfigRegs.EMIF1MSEL.all = 0x93A5CE71;
EDIS;
* u16Mod = * u16Src; // Or memcpy
EALLOW;
Emif1ConfigRegs.EMIF1MSEL.all = 0x93A5CE70;
EDIS;
}
/ ************************************************* *********************************** /
Using this code,
- Main routine
- External interrupt
During the above state, data is being written to the external memory.
There is a problem with this code, for example
01.Acquiring EMIF1MSEL in the main routine
02.External interrupt occurs when EMIF1MSEL is 1
03.Since EMIF1MSEL is 1, external interrupt cannot grab EMIF
For this reason, the processing loops.
(The condition of processing when t == 1 is not implemented because a new problem may appear.)
In order to avoid the above problem, interrupt disable processing is used.
Asm ("setc INTM")
Asm ("clrc INTM")
Although set above and below the main routine EMIF processing,
A processing loop like the example above will occur.
Isn't this instruction set to disable interrupts?
The parameters set in EMIF are as follows.
================================================== =============================
// Configure to run EMIF1 on full Rate (EMIF1CLK = CPU1SYSCLK)
EALLOW;
ClkCfgRegs.PERCLKDIVSEL.bit.EMIF1CLKDIV = 0x0;
// release EMIF1
Emif1ConfigRegs.EMIF1MSEL.all = 0x93A5CE70;
// Configure the access timing for CS2 space
EDIS;
ASync_cs2_config (0,0x01,0x03,0x01,0x08,0x01,0x01,0x02,0x01,0x00,0x00);
================================================== =============================
I would like one more thing.
Is there a way to make the above EMIF processing faster?
There is no room in the processing time of 1 loop of CPU1, (within 1Loop 10us)
With the above EMIF code, EMIF processing takes up a lot of processing time.
best regard.