5 Replies Latest reply on Sep 4, 2012 5:26 PM by helic_263931

    trq pin of DMA


       Can any one explain the usage of 'trq ' pin in DMA....and as well CyDmaChSetConfiguration(....uint8 tddone0, uint8 tddone1, uint8 tdstop);


      The three parameters in this API....

        • 1. Re: trq pin of DMA

          The trq pin can be used the end a DMA transfer prematurely. When it goes high during a running DMA transfer, it will be aborted (as if the transfer count has been reached). In all other cases it will get ignored.


          This gets explained in the data sheet of the DMA component.


          The three parameters you are looking at are not intended for use (AFAICS). In my project, they are set to (as generated by the DMA wizard IIRC):




          and then they get assigned by the CyFitter process (which fills in these constants).

          • 2. Re: trq pin of DMA

            I also have not found an example of the use of the trq. I plan to use it like this:
            DMA makes the transfer of 1000 bytes from the devices in the real-time mode every 1000 MS, but the device does not always have time to prepare all the data.
            I plugged the trq contact to the signal from the timer 1000 mSec.
            If within the period of 1000mSec DMA will receive less than 1000 bytes - the trq will finish the transfer  of forced and the new transmission will begin without delay.
            I hope that I use trq correctly.

            • 3. Re: trq pin of DMA

              Yes, that sounds right. Other options might be to transfer one byte at a time, then your device signals when the next byte is ready. Or the device signals when the buffer of 1000 values is full.

              • 4. Re: trq pin of DMA

                saw two variants:
                1. The device knows that for the current TD data will no longer be. It may end current  TD by the positive edge of the trq. Next TD will begin.
                2. When the time allotted for the TD was over, I can send  the positive edge to trq and complete the TD. Next TD will begin.
                Perhaps there are still variants of use of trq?

                • 5. Re: trq pin of DMA

                  From a standpoint of the DMA component, both are the same use case. TRQ just finishes the current DMA transfer. Note that the timeout will be difficult - the DMA will request as many bytes as you said it should from your device. It doesn't care how long the device needs to produce them - it just requests them at full speed.