Hello, I agree completely with you : the 16bit limit for the count register is very low. However, even with this, you may achieve honorable transfer rates for a 33MHz PCI interface. What I do is breaking the transfer in chunks of 64KB-4Bytes (0xFFFC). The main transfer function stores the transfer params in some global variables. Then, it calls a function that actually starts the transfer of one chunk. After each transfer, the PCI interrupt is trigged. It checks the MASTEROK bit, programs the next chunk, and go on. When the whole transfer is finished, it posts a semaphore. I have quickly written here below how my functions look like (may be several errors in it -> no much time to write it now... sorry) I hope it helps J-F unsigned int PCI_Tfer_Async(...) { // Store tfer params (to be used by PCI_TferNextChunk) // Start First chunk (must be protected against reentrancy) PCI_TferNextChunk(); } void PCI_handler(void) { // Check last tfer status // Is there another chunk to tfer ? // If yes : PCI_TferNextChunk(); // If no : transfer finished SEM_ipost(&SEM_PCITFER); } unsigned int PCI_Tfer_poll_end(void) { return SEM_pend(&SEM_PCITFER, SYS_POLL); } unsigned int PCI_Tfer_wait_end(void) { return SEM_pend(&SEM_PCITFER, SYS_FOREVER); } unsigned int PCI_Tfer_Sync(...) { PCI_Tfer_Async(...); PCI_Tfer_wait_end(); } void PCI_TferNextChunk(void) { // Check if total count has been transferred // If no, prepare next chunk (0xFFFC or remaining cnt), // program & start tfer } |