Other Parts Discussed in Thread: OMAPL138
Tool/software: Code Composer Studio
Hello, I'm sorry to disturb you, we have some confusion and need your help and answers.
In the subject of using the OMAPL138 development board to implement embedded synchronous sampling, the sampling frequency requires 96K, and the timer 2 frequency is 228MHz. The theoretically calculated timing period is 10μs. After many experiments, we found that the fastest timing period is 11.8μs.
In the Code Composer Studio simulation software, we have optimized the program. In the timer interrupt program, the program is relatively simple, including clearing the interrupt flag and operating the I/O port to achieve the light on and off. After the program is streamlined, the timing cycle is still Not fast enough to meet our requirements.
Why is this? Quite confused, I hope to get your answers and help.
The timer interrupt program is as follows:
void TimerIsr(void)
{
int emif_rbuffer0, emif_rbuffer1, emif_rbuffer2, emif_rbuffer3, emif_rbuffer4, emif_rbuffer5, emif_rbuffer6, emif_rbuffer7;
// Clear interrupt flag
TimerIntStatusClear(SOC_TMR_2_REGS, TMR_INT_TMR12_NON_CAPT_MODE);
HWREG(SOC_GPIO_0_REGS + 0x14 + (0x28 * 0)) ^= 1;
HWREG(SOC_GPIO_0_REGS + 0x1C + (0x28 * 2)) = (1 << 29);
HWREG(SOC_GPIO_0_REGS + 0x18 + (0x28 * 2)) = (1 << 29);
emif_rbuffer0 = ((int *)SOC_EMIFA_CS2_ADDR)[0]; //Read the AD value of 8 channels
emif_rbuffer1 = ((int *)SOC_EMIFA_CS2_ADDR)[1]; //Read the AD value of 8 channels
emif_rbuffer2 = ((int *)SOC_EMIFA_CS2_ADDR)[2]; //Read the AD value of 8 channels
emif_rbuffer3 = ((int *)SOC_EMIFA_CS2_ADDR)[3]; //Read the AD value of 8 channels
emif_rbuffer4 = ((int *)SOC_EMIFA_CS2_ADDR)[4]; //Read the AD value of 8 channels
emif_rbuffer5 = ((int *)SOC_EMIFA_CS2_ADDR)[5]; //Read the AD value of 8 channels
emif_rbuffer6 = ((int *)SOC_EMIFA_CS2_ADDR)[6]; //Read the AD value of 8 channels
emif_rbuffer7 = ((int *)SOC_EMIFA_CS2_ADDR)[7]; //Read the AD value of 8 channels
if((emif_rbuffer0>=Sound_th)||(emif_rbuffer1>=Sound_th)||(emif_rbuffer2>=Sound_th)||(emif_rbuffer4>=Sound_th)||(emif_rbuffer6>=Sound_th)||(Sample_Start==1))
{
Sample_Start=1;
m0_data[data_count] = emif_rbuffer0;
m1_data[data_count] = emif_rbuffer1;
m2_data[data_count] = emif_rbuffer2;
m3_data[data_count] = emif_rbuffer3;
m4_data[data_count] = emif_rbuffer4;
data_count++;
if(data_count >= SAMPLENUMBER)
{
data_count = 0;
Sample_Start=0;
}
}
}
