G120 RLP with SPI and DMA

Hi,
has anyone used DMA in RLP on a G120 already?
What I try to do is set up an DMA so it constantly reads my 8 channel ADC which is connected to the G120 via SPI, into an ring buffer.
I read the DMA section of the LPC178x handbook, and I think it should not be too hard to do this.

I write my 8 Control words into Memory and set up an Memory to peripherial DMA with a Looping LLI entry.
Then I set up my receive buffer (any size in multiple of 8 words) and set up a peripherial to Memory DMA for this, also with an Looping LLI entry.

What I haven’t seen so far is how chipselect can be done here. Since my ADC triggers it’s measurement on chip select, I need it.
I also do not see how I can set up the Transfer rate of the DMA, so I can get a specific sample rate.

Has anyone some ideas for this, even if it’s just a “don’t do this”, or a “you should look at that”

Any help is appreciated,
Reinhard.

I have a related/follow up question to GHI.
I’m using a G120 with RLP.
All issues occur with FW V4.3.6 and 4.3.8.1.

I’m quite unhappy with the RLP->Task function.
it is always 13usec. late, so I have to subratct this from my scheduled time.
But sumetimes my callback is invoked too early !?
Also the relative Timing generates quite some jitter.
So in fact it’s quite useless fo my application.

So I was checking if any of the 4 timers is eventually not in use by reading the Registers.
To my wonder only LPC_TIM0 is used. 1…3 have no Interrupt installed, TC and Control Register are always 0.

using LPC_TIM1 instead of the RLP->Task solves all my issues.

So here my question:
Can you confirm, that LPC_TIM1 … LPC_TIM3 are not used in the Firmware by some function that is just not yet initialized by my app?

@ Reinhard Ostermeier -

As I know only TIMER0 is used in firmware.

1 Like

@ Reinhard Ostermeier - Keep in mind that anything may change in future firmware versions.

@ John - Sure, I only Change Firmware when I have to. Used 4.3.6 so far and was quite happy with it, but I might switch to the latest now.
Never run a touching System :smiley: