View previous topic :: View next topic |
Author |
Message |
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
DSPIC33 using DMA |
Posted: Sat Apr 05, 2008 3:50 am |
|
|
Hi,
How can I use DMA on the DSPIC33F, I found in the reference manual
the following code
unsigned int ecan1msgbuf[32][8] __attribute__(space(dma))
This is for the MPLAB C30 compiler, how to translate to the CCS compiler ?
Chris |
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Sat Apr 05, 2008 6:24 am |
|
|
The CCS DMA functions are described in the "HELP" files of the latest compiler (4.071). There is a Functional overview section also. Sorry, I haven't used it yet but I need to dive in next week. |
|
|
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
|
Posted: Sat Apr 05, 2008 6:38 am |
|
|
Hi,
Where did you find DMA in the help file ??
I searched, but can't find anything.
Chris |
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Sat Apr 05, 2008 6:45 am |
|
|
I use PCW and the main window has a "?" in the upper right. Just click it. |
|
|
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
|
Posted: Sat Apr 05, 2008 6:49 am |
|
|
I understand,
But I don't know where to find dma support it in that help file |
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Sat Apr 05, 2008 6:54 am |
|
|
OK, go to "Contents" then down to "Functional Overviews"; click the + sign, then down to "DMA". The functions are active links. |
|
|
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
|
Posted: Sat Apr 05, 2008 7:02 am |
|
|
sorry to say,
But in my functional overview is no DMA topic
I use the latest CCS 4.071 version.
Strange ????? |
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Sat Apr 05, 2008 7:17 am |
|
|
Yes, strange??
send me your email in a PM and I will try to send you the file.
You could also look in your PICC directory for a "Help" or "Readme" file.
I use the auto update system and it was just there? |
|
|
ChrisK
Joined: 02 Apr 2008 Posts: 12
|
|
Posted: Sat Apr 05, 2008 7:25 am |
|
|
I found it,
In the PICC directorie are indeed several help files, I was reading by default the ccsc.chm help file, but in the pcd.chm file is indeed DMA info.
But let's go on to the next question.
The sample code says that setup_dma(1,dma_in_spi1,dma_byte)
What is dma_in_spi1 ?? and where is it defined (or do I have to define it by myself, what to define ??)
Is it the DMA interupt code for the SPI1 ?? |
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Sat Apr 05, 2008 8:19 am |
|
|
As I said before, I have not used DMA yet. Look in the .h file for your device for the #define DMA's You will also have to refer to the MC PIC33 guide and device sheets.
This is what separates the men from the boys. LOL |
|
|
klanglais
Joined: 28 Mar 2008 Posts: 6 Location: 70 Industrial Way Wilmington, ma 01887
|
More DMA questions |
Posted: Thu Apr 10, 2008 2:37 pm |
|
|
I just followed this thread. Now I am stuck. I am using a PIC24HJ256GP610. The 24HJ256GP610.h has this define:
#define DMA_IN_ADC1 (0x0D0000|getenv("sfr:ADC1BUF0"))
When I use it in the setup_dma() I get his compiler error. I am using 4.071.
#include "24HJ256GP610.h"
#INT_DMA0
char adcbuf[100];
void Init_DMAC0( void )
{
setup_dma(0, DMA_IN_ADC1, DMA_BYTE, (int) &adcbuf);
}
Executing: "C:\Program Files\PICC\Ccsc.exe" +FD "init_DMAC0.c" +EXPORT +DF +LN +T +A +M +Z +ICD +Y=0 +EA I+="..\h"
*** Error 12 "init_DMAC0.c" Line 53(27,28): Undefined identifier sfr_ADC1BUF0
C:\Microchip demo\source\init_DMAC0.o ===> 1 Errors, 0 Warnings.
Thanks
Ken
|
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Thu Apr 10, 2008 3:36 pm |
|
|
It looks like a typo; sfr:ADC... or sfr_ADC...
Try changing the .h file to the _ ?
I have found a few typos like this. |
|
|
|