Altera_Forum
Honored Contributor
12 years agoIncreasing SPI Clock Speed via Software
Hi,
the SPI core I integrated in my SoPC is set to 400kHz. Now I would like to increase the speed up to 20 MHz. I had to set the clock speed to 400kHz because SD-Cards only support clock speed up to 400kHz during the intialization process. Anyway, is it possible to chance the speed of the SPI? In the system.h file I found the value of the target clock speed. However, attempting to change the value didn't work for me.#define ALT_MODULE_CLASS_xSD_SPI altera_avalon_spi#define XSD_SPI_BASE 0x40000000# define XSD_SPI_CLOCKMULT 1# define XSD_SPI_CLOCKPHASE 0# define XSD_SPI_CLOCKPOLARITY 0# define XSD_SPI_CLOCKUNITS "Hz"# define XSD_SPI_DATABITS 8# define XSD_SPI_DATAWIDTH 16# define XSD_SPI_DELAYMULT "1.0E-9"# define XSD_SPI_DELAYUNITS "ns"# define XSD_SPI_EXTRADELAY 0# define XSD_SPI_INSERT_SYNC 0# define XSD_SPI_IRQ 11# define XSD_SPI_IRQ_INTERRUPT_CONTROLLER_ID 0# define XSD_SPI_ISMASTER 1# define XSD_SPI_LSBFIRST 0# define XSD_SPI_NAME "/dev/xSD_SPI"# define XSD_SPI_NUMSLAVES 2# define XSD_SPI_PREFIX "spi_"# define XSD_SPI_SPAN 32# define XSD_SPI_SYNC_REG_DEPTH 2
#define XSD_SPI_TARGETCLOCK 400000u# define XSD_SPI_TARGETSSDELAY "0.0"# define XSD_SPI_TYPE "altera_avalon_spi"