- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have a look at AN52705 - getting started with PSoC DMA. It explains how to set up DMA for your use case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Bob,
Thanks,i will try.