This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need Helpb related SPI communication LPC2378

Dear Sirs,
Here I am trouble in SPI communication (LPC2378 master mode).I set all registers properly.
whenever I writing opcode (any value) on S0SPDR (data register),data transfer flag is set.but S0SPDR register showing 00 (zero).ie. I am not able to write data on data register.

so where is problem?

regards
Shyam T.

Parents
  • Writing a byte to the data register does not always mean that you can read back what you wrote. Reading from the register is intended to read the received data, not the data you are about to send. But you have to give the chip time to perform a transfer until there will be something to receive. And if you run in the simulator, then you must write a simulator script that will react to the SPI transfer and return back anything - the simulator don't have real MISO and MOSI signals to perform SPI communication on.

Reply
  • Writing a byte to the data register does not always mean that you can read back what you wrote. Reading from the register is intended to read the received data, not the data you are about to send. But you have to give the chip time to perform a transfer until there will be something to receive. And if you run in the simulator, then you must write a simulator script that will react to the SPI transfer and return back anything - the simulator don't have real MISO and MOSI signals to perform SPI communication on.

Children
  • Thanks for reply.
    ok, that is why i was not able to observe dataregister (S0SPDR).
    Today I on my UART and send each responce on hypertermanil.I observe that when i send my write opcode (0x87)than at same time i read responce and send it to hyperterminal I got OxFF reponce on hyperterminal.what it means? Is opcode is appropriate reach to dataflash or not?

    wating for ur reply....

    Regards
    shaym T.
    Pune India

  • Dear Sir
    Thanks for replying,
    I got solution, now my SPI communication is working.
    I found in trouble when I was sending dummy data.

    regards
    Shyam T.
    pune India