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.

DMA HW triggering at fixed frequency

Other Parts Discussed in Thread: HALCOGEN

Hi,

I'm writing an application on TMDX570LS32HDK requiring to use DMA to transfer one byte a time from a RAM buffer to the het1 DOUT register at a fixed known frequency.

I suppose that HW request for DMA must be used but reading the documentation I cannot understand where the HW trigger can be generated. Is a clock? Is the output of another fixed-frequency- driven device? Can it be setup using HalCoGen?

Thank you,

Matteo

  • Hi Matteo

    The DMA request is triggered as a side effect of certain N2HET instructions, so you actually include the DMA request in the N2HET code that you write as a field in the instruction.

    If you are using the LS03x series;  there is no DMA module on the device.  There is however an HTU tied to the N2HET that is a DMA dedicated to N2HET.

    The triggering mechanism for HTU v.s. DMA is still the same - part of the instruction field of certain instructions.

    There is an appnote SPNA130a that you can start with.  I believe it was written for the LS31x series so it may need a little mod to make it work on LS03x but it will get you going.

    -Anthony

    EDIT: Correction to link

  • Hi Antony,

    thank you for the answer but your link is broken, can you please control it?

    In the mean time can you brefly explain how to setup the HET2 (because the HET1 DOUT is the target of my data transfer) to emit the right trigger frequency? Should I setup a PWM for a square wave and act on some other registers to enable DMA trigger?

    Can the procedure be done in HalCoGen or does it requires HET assembler programming?

    thank you,

    Matteo

  • Hi Matteo.

    I fixed the link above.   You will need to customize the HET assembly program.  HalCoGen does have a way to import a HET program that you write so in this sense yes you can do this with HalCoGen but you will also need to modify the HET assembler program you are using to generate the request as the appnote shows.

    There is a code download .zip file that goes with the appnote.  I'm not at a machine at the moment that can download this (traveling) but I expect that you will see additional HTU and HET configuration register writes that are probably not supported in HalCoGen's GUI today.    Like other modules for some of the more advanced configurations you can get most setup in HalCoGen but have sometimes to write to a few additional registers using the register .h file definitions that come with halcogen...

    I don't think I understand the quewstion regarding HET2 v.s. HET1 because the LS03x only has a single HET module.   But generally you can chose to make the instruction that toggles the pin also generate a request, or you could use two separate instructions (one for the pin, the other for the request) with some time delay.  It all depends on what you are trying to accomplish.   If you just want to automatically DMA the period for the next PWM when you toggle the pin at the end of the current PWM you can probably use the same instruction.  But you might want to consider that there will be delay from the DMA generation to the HTU write.   So you might want to construct your HET program so that after the pin toggle,  there is a copy from a 'buffer' location in the N2HET RAM to the PWM next period, so that this 'next' period will be in place at the start of the next loop resolution guaranteed.   Then trigger an HTU request using a separate instruction to update this buffer location.   In this way your program will be able to tolerate more latency between the HTU and the memory system  but it also will add latency in the sense that the updates the CPU makes to the RAM buffer will take up to two loop resolution periods to make it to the PWM pin.  

    This is something you'll need to decide as a strategy as appropriate for your application.   If you have a very tight loop resolution though, like /8 or /16, I think the double buffer is probably a must.

    Anyway this is probably something you can decide after you get started - I'd start w. the example to get an understanding of how this works and then we can discuss more the best strategy for your particular app.

     

    Best Regards,

    -Anthony

  • Hi Antony,

    inside HalCogen I can see two different HET1 and HET2 with separate driver enable check, pinmux settings and two separate tabs for functions settings. Doesn't this mean they are two separate devices?

    About my problem: what I need is simply to generate a HW trigger for DMA. Ignoring that the target is to write the DOUT register: the only way to trigger DMA at a fixed frequency involves HET assembler (and is undocumented in the Technical reference)? There's no simpler way? I'm surprised.

    Matteo

  • Hi Matteo,

    This also depends on the part # ... whether it's the LS0332 or the LS3137.   The LS0332 has no DMA, one N2HET, and one HTU.   The LS3137 has DMA in addition to 2 N2HET and 2 HTU's.    

    If you are on the LS3137 then if you look at the DMA request line connection table (4-33) in the TRM, you can see that RTI which has 4 compares can be used to trigger the DMA.  If you want a fixed frequency DMA request this is probably the easiest way possible to get one.

     

    If you're on the LS0332 with the only "DMA" being the HTU you will need to write an N2HET program that makes 2 HTU requests for each 'DMA request' that you want to simulate.  (HTU always has either it's source or destination be the N2HET RAM --  so to do a memory or memory copy you need one  memory source -> N2HET RAM  HTU transfer followed by a second HTU transfer that goes N2HET RAM -> memory dest.)

    -Anthony