Hi all,
I have a Lyrtech EVMDM648 equipped with a TMS320DM648 dsp, and I need to write a SPI interface between the dsp and a SPI EEPROM (ATMEL730 25256A).
The board mux settings (not the DSP mux settings) between UART and SPI are surely correct (I had to turn off a dip switch); furthermore, i verified
that the EEPROM has to be configured in MSB-first shift mode.
The code that I wrote in CCS to configure SPI interface is the following:
PINMUX |= (1 << 12); // SPI enable on PINMUX
PINMUX &= (0xFFFFDFFF) // UART disable on PINMUX
SPIGCR0 = 0; // reset SPI peripheral
SPIGCR0 = 1; // remove reset from SPI peripheral
SPIGCR1 = 0x00000003; // enable clock mode and master bits
SPIPC0 = 0x00000E01; // enable SPIDI, SPIDO, SPICLK, SPICS0
SPIFMT1 = 0x00000008; // configure WORD LENGTH = 8 bit
// configure MSB-first shift mode
// configure POLARITY = 0, PHASE = 0
SPIFMT1 |= (0x13 << 8) // configure CLK_PRESCALE = 0x13, to obtain a SPI_CLOCK = 7.5 MHZ;
SPIDAT1 = 0x00020000; // select SPICS0 only
SPIDAT1 |= (1 << 24); // selecting DATA_FORMAT 1
SPIDAT1 |= (1 << 28); // selecting CSHOLDMODE
SPIGCR1 |= (1 << 24); // SPIEN enable
The problem is: when I write a RDSR command (Read Status Register, value = 5) in the shift register, like this:
SPIDAT1 |= 5;
I always get an 0xFF value, as if the pins were in high impedance state.
Can you help me please? Do you think configuration is correct?
Thanks in advance
Giulio