regarding spi interface

Discussion in 'Embedded Systems and Microcontrollers' started by divyarna, Apr 18, 2012.

  1. divyarna

    Thread Starter New Member

    Apr 18, 2012
    2
    0
    Hi i am doing an 8051 based microcontroller project where in i am trying to interface the 8 bit microcontroller with an 16 bit sensor. I am not sure if these two devices can be interfaced, please help. The spi register in the microcontroller is 8 bit and that in the sensor is 16 bit.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,791
    You have asked a question without providing any useful information. How's about a link to the sensor datasheet. SPI is inherently an 8-bit protocol as originally defined by Motorola (now ON-Semiconductor and Freescale). For a 16-bit device it is likely to require multiple 8-bit SPI bus transactions to accomodate a 16-bit device.
     
  3. divyarna

    Thread Starter New Member

    Apr 18, 2012
    2
    0
  4. Papabravo

    Expert

    Feb 24, 2006
    10,144
    1,791
    OK got it. What will happen is that you break the 16-bit transaction into two 8-bit transactions. what the sensor sees is Chip-Select followed by 8 clocks with arbitrary, null-data going out and the most significant 8-bits from the sensor coming in. Then there will be a short idle period DURING WHICH THE CHIP SELECT MUST REMAIN LOW, followed by another 8-bits of arbitrary null-data going out and the least significant 8-bit bits coming back in. then you take the chip select high and all is well.
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    The bit size of a processor has nothing to do with its capabilities.
    Calculators use 4-bit processors.
    You can interface an 8-bit processor to a 16-bit processor with no problem.

    There are 10 types of people in the world. Those who understand binary and those who don't.
     
    Last edited: Apr 23, 2012
  6. @android

    Member

    Dec 15, 2011
    178
    9
    Fully agreed!

    LOL :D That is my messanger signature!
     
Loading...