What we see when read a seqence of bytes (look in attach): 24 MHz SPI clock in byte packet and then 800 nsec sleeping between the packets!
As a result - the fact data transferring is no more than 400KB/sec@24MHz SPICLK!
mE developers, remove the gap and the speed will increase more than twice!
Increase SPI data transferring speed!
Increase SPI data transferring speed!
- Attachments
-
- pic_101_2.jpg (104.81 KiB) Viewed 6171 times
Last edited by Const50 on 01 Jan 2017 06:36, edited 1 time in total.
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: Increase SPI data tranferring speed!
Hi,
Can you send me the minimal project that represents this issue,
packed in the zip file, so I could test it?
Please tell me what kind of hardware do you use?
Regards,
Nadir
Can you send me the minimal project that represents this issue,
packed in the zip file, so I could test it?
Please tell me what kind of hardware do you use?
Regards,
Nadir
Re: Increase SPI data tranferring speed!
Where to send? Address?
Re: Increase SPI data tranferring speed!
Some things in your picture suggest that the reading was done from an SD card, which gives certainly a delay between bytes.Const50 wrote:What we see when read a seqence of bytes (look in attach): 24 MHz SPI clock in byte packet and then 800 nsec sleeping between the packets! As a result - the fact data transferring is no more than 400KB/sec@24MHz SPICLK!
mE developers, remove the gap and the speed will increase more than twice!
Additionally it suggests the reading was done via a fat32 library, which will give a delay between sectors (not visible however between 2 bytes).
See also http://forum.mikroe.com/viewtopic.php?f ... lit=+speed for previous discussions about SPI and Fat.
See http://forum.mikroe.com/viewtopic.php?f ... 15#p253124 for some raw speed measurements (no SD card, no fat).
Can you show the code (and the PIC confuration) used in your test? Thanks in advance.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: Increase SPI data tranferring speed!
Yes the SD gives delay, but far not 800 nsec, we tested it with 3 different SD manufacturer.
No, here is been used FAT16 and SD 2GB. But you right, between sectors there is a gap, but its size not influences so, as the gap between bytes.
The code is standard your MMCFAT16 library:
On the picture we see the sequence of sectors reading. We see the gaps between sectors are big, but less than the sector reading time. When we read a byte, its time is 2.5 times more than that for a byte reading.
No, here is been used FAT16 and SD 2GB. But you right, between sectors there is a gap, but its size not influences so, as the gap between bytes.
The code is standard your MMCFAT16 library:
Code: Select all
BSTCount = 19326 ' bytes, the size of file WF.wbf
MMC_FAT_ASSIGN ("WF.wbf", 0) ' preparation for reading from SD (do you remember, we had the problem with this line with another PIC, PIC220F?
MMC_FAT_RESET(BSTCount) ' file variable set to first byte (position)
MMC_FAT_READN(@fdata,BSTCount-1) ' Read bytes from file WF.wbf to RAM PIC
- Attachments
-
- 470.png (324.32 KiB) Viewed 6126 times
-
- pic_102_4.jpg (151.02 KiB) Viewed 6126 times
Re: Increase SPI data tranferring speed!
I see that you are using only an 48 Mhz CPU clock. The measurements I did myself were with a 80 Mhz CPU clock. The gap between bytes also depends on the clock speed.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: Increase SPI data tranferring speed!
The 48 MHz limited by HW SPI "PIC32MX470F512H: Communication interfaces: •Two 4-wire SPI modules (25 Mbps)". What MCU PIC did you used with 40 MHz SPI? Do you mean PIC32MZ?
Last edited by Const50 on 15 Dec 2016 03:37, edited 2 times in total.
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: Increase SPI data tranferring speed!
Hi @Const50,
I apologize for the delayed reply.
You can attach here or in the PM.
Best Regards,
Nadir
I apologize for the delayed reply.
You can attach here or in the PM.
Best Regards,
Nadir
Re: Increase SPI data tranferring speed!
Look at message at 11 dec abowe.
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: Increase SPI data tranferring speed!
Hi @Const50,
I will investigate this, and get back to you.
Regards,
Nadir
I will investigate this, and get back to you.
Regards,
Nadir