How to set DMA function in my project ? - Cypress.com Forums http://www.cypress.com/? Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57528 Thanks for you kindly reply,and i can solve the problem by you suggestion! smiley

And hope  you have a happy new year

]]>
Mon, 26 Dec 2011 00:30:29 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57458 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

]]>
Fri, 23 Dec 2011 04:27:30 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57449  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

 

 

****************

 

]]>
Fri, 23 Dec 2011 02:07:55 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57448 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.

]]>
Fri, 23 Dec 2011 02:06:05 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57447  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()

]]>
Fri, 23 Dec 2011 02:04:58 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57432 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!

]]>
Thu, 22 Dec 2011 21:05:16 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57406  The app note that is pointed out in the previous post should help.

]]>
Thu, 22 Dec 2011 11:35:13 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57398 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 .

]]>
Thu, 22 Dec 2011 09:21:39 -0600
Re: How to set DMA function in my project ? http://www.cypress.com/?rID=57384  Upload your project so people here can help

]]>
Thu, 22 Dec 2011 04:03:38 -0600