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 CCS Technical Support

PIC18F24J11 SPI max. data transfer speed = 6Mbps with DMA?

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



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PIC18F24J11 SPI max. data transfer speed = 6Mbps with DMA?
PostPosted: Wed Feb 01, 2012 12:57 pm     Reply with quote

I would like to check if I´m doing something wrong.

I´m using the PIC18F24J11. It is running on 48MHz. I set the Spi to 12MHz. I set DMA to work with SPI transfers because I would like to reach the maximum SPI data transfer.

Even using DMA, my SPI transfered only 6Mbps running at 12MHz(spi clock pin), because for every transmitted byte it waits another byte(8 cycles) without transfer. I´m not using SPI SS pin.

My SPI config is:
Quote:
#USE SPI(SPI2, MASTER, BAUD=120000000, MODE=0, BITS=8, MSB_FIRST, STREAM=RF24_SPI)

DMA driver I made myself. So I do not need to use spi_xfer() for transfer data. It automaticaly starts everytime I fill DMA registers and Enable DMA transfer.

My question is: Am I setting something wrong or Microchip PIC can´t send SPI continuously?

Thanks.
Eduardo
_________________
Eduardo Guilherme Brandt
temtronic



Joined: 01 Jul 2010
Posts: 9250
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 01, 2012 3:35 pm     Reply with quote

baud=120,000,000 ??? is that correct ???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 01, 2012 3:44 pm     Reply with quote

Quote:

#USE SPI(SPI2, MASTER, BAUD=120000000, MODE=0, BITS=8, MSB_FIRST, STREAM=RF24_SPI)

I set the Spi to 12MHz.

Look more closely at the Baud number.


Quote:
because for every transmitted byte it waits another byte(8 cycles) without transfer.

Read the DMACON2 section of the 1824J11 data sheet:
Quote:
19.4.4.2 DMACON2

By default, the hardware requires a minimum
delay of
: 8 TCY for FOSC/4, 9 TCY for FOSC/16
and 15 TCY for FOSC/64. Additional delays can be
added with the DLYCYC bits. In SPI Slave modes, the
DLYCYC<3:0> bits may optionally be used to trigger an
additional time-out based interrupt.
Eduardo__



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

PostPosted: Wed Feb 01, 2012 3:47 pm     Reply with quote

Yes, You´re right! WHAT A PITY!!!

Thanks a lot again Mr. PCM!
_________________
Eduardo Guilherme Brandt
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