Hallo everyone,
I'm trying to implement SPI TX with DMA using RH850/F1KM-S4 and try to implement following flow
chip select pin Low --> write first data to CSIG2TX0H --> INTDMA0 triggerd, set flag A --> IF A & !(CSIG2STR0&(1<<7) --> chip select pin high.
On the oscilloscope i can confirm that chip select pin was toggled high -> low -> high. But only the first data was transmitted (i.e. DMA transfer is not happening).
How can INTDMA0 is still triggered?
I think i solved the problem.
I changed DMAC0DM00CM = _DMAC_PE1_SETTING | _DMAC_SPID0_SETTING | _DMAC_SUPERVISON_MODE;
which is translated to 0x0010 to DMAC0DM00CM = 0x0000 and use _DMAC_SINGLE_TRANSFER since ICCSIG2IC was triggered after TX is completed.
So my question will be, how one determine the value of SPID[1:0] und PEID[2:0]?
Hello Arno,
you should be able to determine the value of SPID[1:0] und PEID[2:0] from the PDMAnDMyiCM register:
Best regards,
Erik
Hi Erik,
thanks for the reply. I'm a little bit confused. The value after reset for PDMAnDMyiCM is 0x0010, when I try to used DMAC00 I need to change PDMA0DM00CM to 0x0000 so it can work.
My question is, if I want to use DMAC17 do I need to set PDMA1DM17CM to 0x0071 ?
Hi Arno,
we are currently investigating your question. Which IDE do you use? Are you generating your code with the Smart Configurator?
Yes i used smart configurator for setting-up DMAC. I use GHS for compiling and VScode for editing.
Thanks in advance.
Cheers
Arno
You can check my code if you want : https://github.com/ThibaudetTevai/RH850U2A8---MSPI-TX-with-DMA
is it possible for you to share the project or at least the values of the Smart Configurator, so we can take a look at it?
I dont think i can share the project. what value from Smart configuration do you need. maybe i can provide here. If i can write a source code on the forum (i tried so many times, it always failed/didn't get post)
test code
that's ok. Can you provide me screenshots of all Smart Configurator settings regarding DMA?
Thank you.
I added Source Address and Transfer Count in script, since the idea is to put those values in run-time. I did stop the CISG before changing the values.