Skip to main content
Visitor II
January 25, 2006
Question

DVP3 spi Bug

  • January 25, 2006
  • 1 reply
  • 486 views
Posted on January 25, 2006 at 06:49

DVP3 spi Bug

    This topic has been closed for replies.

    1 reply

    sjoAuthor
    Visitor II
    January 25, 2006
    Posted on January 25, 2006 at 06:49

    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