trq pin of DMA

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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....

0 Likes
5 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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):

   

 CyDmaChSetConfiguration(DMA_DmaHandle,
                                BurstCount,
                                ReqestPerBurst,
                                DMA__TERMOUT0_SEL,
                                DMA__TERMOUT1_SEL,
                                DMA__TERMIN_SEL);

   

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

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

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.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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.

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

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?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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.

0 Likes