2006-01-24 09:49 PM
2006-01-24 09:49 PM
Hi,
Found really strange one with the DVP3 emulating a ST72F264 spi. If i set the spi clock mode as below it works ok SPISR = 0b00000011; SPICR = 0b01111100; // CPOL=1, CPHA=1 If i change the clock mode to CPOL=0, CPHA=0 it gets stuck waiting for the SPIF bit to set. SPISR = 0b00000011; SPICR = 0b01110000; I have tried using the MISCR2 instead but that does made no differance. The same code works ok if using an indart on an actual device. As a further test i used an old DVP2 setup as a 254 all the modes tried worked ok. The code has been used on many st7 applications and like i mentioned above works on the actual silicon. this is my spi send routine BYTE SendSPI(BYTE uData) { SPIDR = uData; do { // check for write collision if( ValBit( SPISR, WCOL )) { _asm(''tnz _SPISR''); _asm(''tnz _SPIDR''); SPIDR = uData; } } while(!ValBit( SPISR, SPIF )); return SPIDR; } Is this a DVP3 bug ? Spen