send datas from components to sram

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

cross mob
Anonymous
Not applicable

Dose anybody have the detail cases that sending data from components to sram?Now i want to send the 100 datas from DFB output register to sram.But i wonder how to set the destination(L16).I think i can use the fuction malloc(),just like

   

int* dst;

   

dst=(int*)malloc(100);

   

then, the destination(L16) is  LO16((uint32)dst),isn't it?

   

but how can i send the datas to the static sram.

   

Maybe just transform the address like int* dst =0x20008000, is right?

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

Have a look at AN52705 - getting started with PSoC DMA. It explains how to set up DMA for your use case.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Also take a look at DFB Assembler -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=60720     DFB Assembler

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Woul it not be easier to allocate some vars as

   

int Target[100];    // use &(Target[0]  or more simple: Target  as the pointer.

   

Your malloc(100) will fail, since an int is not one byte, better would be

   

dst = malloc(100 * sizeof(int)); // makes you independent of the number of bytes an int has got

   

 

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for all the advices. @Bob,your words are right.But did i need to give a specific address(like 0x20008000) to the point before i use the point?Maybe the DMA can only send datas to the specific area of the sram,does'n it?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

It is just the other way round: You tell the DMA where to send the data to. No specific area in sram needed.

   

When starting Creator 3.0 open one of the demo-projects for PSoC5 and DMA. Read about the DMA wizard, too.

   

 

   

Boib

0 Likes
Anonymous
Not applicable

 @Bob,

   

Thanks,i will try.

0 Likes