- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello:
How to configurate the DMA in my project? because i want to disable the
DMA transmission once it finishes transferring the desired data,and i set a
DMADone_flag in my main.c process,but when i build the process,i can't see
the DMADone_flag in project name.map document which disable my debug
processing?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Upload your project so people here can help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, there is a great app note explaining DMA: http://www.cypress.com/?rID=37793 , and a video about it: https://www.youtube.com/watch?v=D1Gz17bPYm0 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The app note that is pointed out in the previous post should help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear:
I konw the app notes in cypress website, and i also studied the notes to guide my design ! But my problem is the
DMADone_flag, i followed the Tools-DMA Wizard to set my DMA component and also configured it in the .cysch
document, and unfortunately, i could not get proper result! Expecting seniors engineer to help me,
Best regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is the vaiables are out of scope.
Your flags are only having local scope to main, and you re-declar those vaiable with the same name in ISR_1,c and ISR_DMA_done.c, those have the same name as that in main.c but they are not the SAME vaiable.
I think you want to use the DMA flags as global
So yuou have to move the declaration of the two flags before main.c
EX
*******
uint8 DMADone_flag1,DMADone_flag2;
void main()
{
....
}
******
also
declare
extern uint8 DMADone_flag,
and
extern uint8 DMADone_flag2;
AND
remove those declaring inside the isr routines
r
at the begining of the software routines.
****
Hope this help
void main()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looking at the code - you don't set the DMADone_flag (neither 1 nor 2) in your code. I cannot look at your hardware sketch right now - did you connect an ISR to the DMA 'nrq' signal? Then just set the flags in your ISR. In your main function, you need to wait within a loop for the flags to be set again, after you have started the DMA transfer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the typos
*****
also
declare
extern uint8 DMADone_flag,
and
extern uint8 DMADone_flag2;
outside the software routines.at the top of the module
AND
remove those declaring inside the isr routines
****************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The basic handling of variables in C are easy to understand: variables are allocated when they are needed and destroyed, when they are not used any more:
A variable declared outside of any function is a so-called global variable and is visiblke (skope) from the point of declaration on throughout the program.
A variable declared inside a function (main() is a function as well!) is a so-called local variable and not only is visible from the point of declaration within the function only, the variable does exist only within this function and is destroyed when the function ends. (This may differ in 8051-implementations of C, but only has to do with code-efficienty and should have minimal effects on programming-style)
When a global variable is re-declared in a function, only the local variabe can be accessed so "hiding" the global var.
There is a good (and critical) handbook for C-language here http://publications.gbdirect.co.uk/c_book/ which rather often helps me out.
Hope this clarifys something.
Have a merry x-mas and may your code never fail
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for you kindly reply,and i can solve the problem by you suggestion! smiley
And hope you have a happy new year