SPI3_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 80, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
FAT32_Init();
SPI3_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 8, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
TMR1=0;
tempoin=TMR1;
for(i=0;i<10;i++){
Mmc_Write_Sector(sc1+i, stringa1);
Mmc_Write_Sector(sc2+i, stringa2);
Mmc_Write_Sector(sc3+i, stringa3);
}
tempoOUT=TMR1;
T1CON.F15=0; // timer1 OFF
that includes all of the overhead within functions that you have not shown
The comparison presumes that Proteus models the internal SD controller timing (e.g. flash write speed) which is rather unrealistic.I want to add that in a previous try with Proteus and PIC18F (64 mhz clock), with the same function of mikroC for writing on sector, the write speed was correct.
You can do by using existing SD card libraries, e.g. FatFs. To test the SPI speed on its own, you can however use the basic MikroC SPI functions.So can anyone tell me how I can write a routine for writing into the sectors of SD card without using the mikroC functions?
while( SPIxSTATbits.SPITBF); // Wait for the SPI buffer to be free to write to
SPIxBUF = txValue; // Start the exchange by sending a value
while( !SPIxSTATbits.SPIRBF); // wait for the exchange to complete
rxValue = SPIxBUF; // Get the value we were just sent
Did you take this to mean that you (as the card driving device) must meet this minimum speed?(the SD is a SDHC with a min speed of 10 MBps )
yes, of course. My english is not perfect, so I can't really explain well. I referred to the minium speed reported here https://en.wikipedia.org/wiki/Secure_DigitalIn other words, you can design a host device knowing that the SD card is able to work at least that fast. However it does NOT mean that it cannot work slower.
I need at least 800 kB/s.However it is the application that drives this and not the SD card itself. I don't think you have told us what your application is doing and what the minimum transfer rate it requires.
Susan
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?