Skip to main content
Visitor II
November 16, 2005
Question

spi - shift by one bit problem

  • November 16, 2005
  • 2 replies
  • 636 views
Posted on November 16, 2005 at 07:28

spi - shift by one bit problem

    This topic has been closed for replies.

    2 replies

    omatzaAuthor
    Visitor II
    November 16, 2005
    Posted on November 16, 2005 at 07:10

    Hello

    I have SPI master board, connected to the PC and send bytes to my application which run on ST7.

    I sent one byte at the time from the PC, and poll to get it on the ST7.

    I see that I have ''shift in the data''.

    for example, When PC send 0x32 = 0b00110010, ST7 gets 0x64 = 0b01100100,

    or when PC send 0x33 = 0b00110011, ST7 gets 0x66 = 0b 01100110.

    (I use CPOL=0 CPHA=1 and the speed is very low 5Khz to 62Khz)

    The ST7 configurate as slave in software SSM=1 SSI=0, and the /SS pin is used as floating input GPIO (but currently not used)

    Any hint ?

    Yours

    Oren

    omatzaAuthor
    Visitor II
    November 16, 2005
    Posted on November 16, 2005 at 07:28

    Hello

    forgot to mention, it can be shit by one in other direction, e.g.

    0x32 = 0b00110010 becomes 0x19 = 0b00011001

    :-[

    Oren