Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - Zum C-Control-I-Forum - Zum C-Control-II-Forum

Re: Speed of SPI Kategorie: Sonstige Hardware (von Torsten - 27.12.2013 11:58)
Als Antwort auf Speed of SPI von PepeV - 23.12.2013 19:54
Ich nutze:
CC-Pro 128 Application Board, Pro-Bot128
> Hi all,
>
> I want to try a new project with my Probot128 to record and play back
> sounds. I can record microphone samples with 7200 Hz with ADC in free
> running mode. But I cannot store the samples fast enough because there
> is only 4 kB SRAM and EEPROM via I2C is too slow. That is why I am
> considering extending my robot with extra SRAM via SPI. The question
> is, is SPI fast enough?
> In assembler surely SPI would be fast enough, but that would probably
> be too difficult for me to program. Could someone tell me how fast SPI
> is via the byte interpreter commands? How long take SPI_Write() and
> SPI_Read()?
>
> Thanks for any help.
> Regards,
> Pepe

Hallo Pepe,

it is a good idea to give the C-Controlsystem more fast memory
which we can manage ourselves, and not only for the ProBot128.
But I would not recommend to use the functions "SPI_Write(...)"
and "SPI_Read(...)" to send several datas. I think it is better
to use the function "SPI_WriteBuf(...)". The SPI-interface is
also very simple to use in assembler. I did a few measurements
with the code below. Look at the file "SPITest-0.01.zip".


Using double speed (prescaler = 2) we have:
 7.37 Mbit/s
 SCK cycle = 2 cpu cycles = 136 ns

The time to send 20 bytes is whith the:
 bytecodeinterpreter = ca. 60 µs
 assembler call      = 38.658 µs

The time between 2 bytes is by the:
 bytecodeinterpreter = 20 µs ?;-(|-<
 assembler version   = 1.2 µs

These times are only the communication-times without the
time for the function calls.

 Gruß Torsten.


SPITest-0.01.zip




    Antwort schreiben


Antworten:

Re: Speed of SPI (von PepeV - 4.01.2014 17:44)