2007-09-06 06:39 AM
2011-05-17 12:46 AM
Hi all!
I have trouble with the SPI port. I’m sending data between two STR912 chip. Later on one will be change to an A/D-converter. The master chip sends two 16-bit words continually over the buss. If I look at the signal with my scope there is no strange with the signal. The slave chip tries to receive the signal. The problem is that it will always miss the first bit. And when the SPP-controller realize that it only received 15-bits it will add an extra bit on the end. The slave is configured to listen to the 2nd clock. Master configuration: **************** SSP0->CR0 = 0x008F; SSP0->PR = 2; SSP0->IMSCR = 0; SSP0->CR1 = 0x2; SSP0->DR = 0xF000; Master send routine: **************** SSP0->DR = 0x8181; //Wait for SPI-unit to send 16-bits while((SSP0->SR & 0x01) != 1 ); SSP0->DR = (0x8000 | spiCount); //spiPattern; spiCount++; Slave configuration: **************** SSP0->CR0 = 0x008F; SSP0->PR = 2; SSP0->IMSCR = 0x00; SSP0->DMACR = 0x01; // Enable DMA on recv. SSP0->CR1 = 0xE; /* slave mode, enable */2011-05-17 12:46 AM
Hi.
What is your transfer speed? What is the line length ? I ask you these thinks because you have to take care of the time that occur to the signal to propagate from the source to the destination. In the past I faced a problem with a SPI for this kind of problem.