This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello everyone,
Thanks to everyone for suggesting me in my previous issues.
Now this time i want to write the data into SD Card by using SPI Communication.Its writing perfect by the below code and i am using 5 interrupts parallel and SD CARD data writing in while loop continuously. Here what i am getting the problem is when the data writing into SD CARD,at that time my other interrupts are stop few milliseconds and again it will start immediately. Here what i want is, I do not want to disturb to my other interrupts when the data writing to SD Card. I attach the code below.
//*****************************sdcard *************************************************
iFResult = f_mount(0, &g_sFatFs);
if(iFResult != FR_OK)
{
return(1);
}
iFResult = f_open(&g_sFileObject, filename, FA_WRITE|FA_OPEN_ALWAYS| FA_READ);
iFResult=f_lseek(&g_sFileObject, f_size(&g_sFileObject));
do
{
iFResult = f_write(&g_sFileObject, buf2, sizeof(buf2) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
}while(ui32BytesWrite != sizeof(buf2)-1);
iFResult = f_write(&g_sFileObject, new_line, sizeof(new_line) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
iFResult = f_write(&g_sFileObject, new_line, sizeof(new_line) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
do
{
iFResult = f_write(&g_sFileObject, buf1, sizeof(buf1) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
}while(ui32BytesWrite != sizeof(buf1)-1);
iFResult = f_write(&g_sFileObject, new_line, sizeof(new_line) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
while(1)
{
strcat(buf_rz,buffer2);
iFResult = f_sync(&g_sFileObject);
iFResult = f_write(&g_sFileObject, new_line, sizeof(new_line) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
for(g=0;g<=2;g++)
{
for(h=1;h<=500;h++)
{
SysCtlDelay(16000);
}
}
iFResult = f_write(&g_sFileObject, buf_rz, sizeof(buf_rz) - 1, & ui32BytesWrite);
iFResult = f_sync(&g_sFileObject);
}
After debugging my code i found that
iFResult = f_sync(&g_sFileObject); is creating the issue to other my interrupts
Please suggest me how to resolve the issue.
Thanks,
Regards,
Srinu.V
Thank you sir for your valuable suggestion,
I am not sure f_sync is only creating the issue. In my code i am observing output results in ccs debugger along with oscilloscope. When the compiler starts execution and when the compiler execute the iFResult = f_sync(&g_sFileObject); instruction, then my PWM Stops working few nano to milliseconds and after completion of the execution of that instruction again my PWM comes into normal previous condition, I am using PWM interrupt for generating PWM Signal.
Please suggest me anything wrong in my code.
My main clock is
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN| SYSCTL_XTAL_16MHZ);
// Configure SysTick for a 100Hz interrupt. The FatFs driver wants a 10 ms tick.
ROM_SysTickPeriodSet(SysCtlClockGet() / 100);
ROM_SysTickEnable();
ROM_SysTickIntEnable();
void
SysTickHandler(void)
{
//
// Call the FatFs tick timer.
//
disk_timerproc();
}
I am using above instructions for clock signals, Please suggest me any mismatch in the clock signals or please suggest me any other instructions required.
I attached the image of my debugger output, when the SD Card starts writing that time CPU RESET is enabling (few nano to milliseconds time) and my PWM interrupt stops for few nano to milliseconds and again CPU RESET disable(within milliseconds) and PWM states will come on normal.This process is going continuously.
I request you to please suggest me how to avoid this issue.
Thanks,
Regards,
Srinu.V
Hai sir,
Thanks for your valuable suggestions.
I attach the snapshot of the SYSCTL_RESC register. I request you to please find the attachment.
when the reset occurs the my compiler goes to below function in startup_ccs.c
void
ResetISR(void)
{
//
// Jump to the CCS C initialization routine. This will enable the
// floating-point unit as well, so that does not need to be done here.
//
__asm(" .global _c_int00\n"
" b.w _c_int00");
}
I request you to please suggest me how to resolve this issue.
Thanks,
Regards,
Srinu.V.