|
|
View previous topic :: View next topic |
Author |
Message |
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
PIC18F24J11 SPI max. data transfer speed = 6Mbps with DMA? |
Posted: Wed Feb 01, 2012 12:57 pm |
|
|
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: 9221 Location: Greensville,Ontario
|
|
Posted: Wed Feb 01, 2012 3:35 pm |
|
|
baud=120,000,000 ??? is that correct ??? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 01, 2012 3:44 pm |
|
|
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
|
|
Posted: Wed Feb 01, 2012 3:47 pm |
|
|
Yes, You´re right! WHAT A PITY!!!
Thanks a lot again Mr. PCM! _________________ Eduardo Guilherme Brandt |
|
|
|
|
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
|