Page 1 of 1

SAM V71 Xplained ISI DMA transfer terminated signal

Posted: Thu Aug 13, 2015 7:27 pm
by lstark
We are implementing an image capture on the SAM V71 Xplained development board. We are using the sama53dx example to guide us. We have successfully initialized the camera using TWI and ISI and are at the point of capturing an image using ISI. The code gets stuck waiting for the DMA transfer terminated signal (ISI_SR_CXFR_DONE). We have used a scope to see data coming from the camera and have seen data using the AtmelStudio debugger in the SRAM image data location. We just can't get the final DMA transfer complete signal.

Has anyone successfully used ISI on the SAM V71 Xplained board? Atmel support is still working on app notes for ISI on this board. Code for image capture shown below. An assistance would be greatly appreciated!

Code: Select all

for (delay = 0; delay < 0xffff; delay++);


for (delay = 0; delay < 0x5ffff; delay++);

Re: SAM V71 Xplained ISI DMA transfer terminated signal

Posted: Thu Aug 13, 2015 8:20 pm
by blue_z
You need to pay better attention to the datasheet (and code accordingly).
Eight status conditions (including the CXFR_DONE that your code is waiting on) in the ISI_SR register are cleared when the register is read.
That means your code has only one (1) chance of detecting the occurrence of CXFR_DONE being set, since your code never saves the value that was read from the status register and always fetches a fresh value.

IOW if CXFR_DONE is set prior to or at the same time as CDC_PND is set, or if an ISR could also read the ISI_SR and compete with the second while loop, then it's very easy to explain the behavior that you report.


Re: SAM V71 Xplained ISI DMA transfer terminated signal

Posted: Thu Aug 13, 2015 8:43 pm
by lstark
Thanks for the quick reply. Your suggestion worked! We had put in a variable for the loop, having actually read the datasheet to see the read clears the bits... but we only mistakenly put it around the second while loop since the first while loop was happy. We removed the variable save code to go back to following the exact steps the sama53dx code was taking. Not quite sure how their code was working, but your suggestion has gotten on to our next step in the program. Thanks again!