SPI how it works.

Discussion in 'Embedded Systems and Microcontrollers' started by gusmas, Aug 2, 2010.

Thread Status:
Not open for further replies.
  1. gusmas

    Thread Starter Active Member

    Sep 27, 2008
    239
    0
    Ok i am using msp430 micro controller and a temp sensor, and i am trying to understand how spi works and how to program it.

    Now from what i understand is this:

    1.MOSI - Master (temp sensor) sends data(temperature) to slave (mirco controller)

    2.Setting the clock phase to 1 or 0 determines if the data is written or read on the falling edge or the rising edge of the clock.

    3. CS(Active Low). When pulled low the data will start to send.

    What I am trying to understand is:

    1.Lets say my temp is 10000000(Binary,MSB is far right) and i want to send that to my micro controller. And my SPI is configured to write on the rising edge of the clock and read on the falling edge of the clock. Will the MOSI go high when the first rising edge of the clock pulse arrives, then go low as soon as the 2nd clock pulse rising edge arrives? and then send a zero along the MOSI line until all 8 bytes are sucesfully read?

    ---------------------------------------------------------------------------------

    I hope I am making sense , its difficult to explain.
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
Loading...
Thread Status:
Not open for further replies.