CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

DSPIC33 using DMA

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ChrisK



Joined: 02 Apr 2008
Posts: 12

View user's profile Send private message

DSPIC33 using DMA
PostPosted: Sat Apr 05, 2008 3:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 6:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 6:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 6:45 am     Reply with quote

I use PCW and the main window has a "?" in the upper right. Just click it.
ChrisK



Joined: 02 Apr 2008
Posts: 12

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 6:49 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 6:54 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 7:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 7:17 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 7:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 8:19 am     Reply with quote

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

View user's profile Send private message Visit poster's website

More DMA questions
PostPosted: Thu Apr 10, 2008 2:37 pm     Reply with quote

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
Embarassed
mkent



Joined: 09 Sep 2003
Posts: 37
Location: TN, USA

View user's profile Send private message

PostPosted: Thu Apr 10, 2008 3:36 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group