Skip to main content
jkim71
Associate II
November 6, 2007
Question

ST712 BSPI clock problem

  • November 6, 2007
  • 2 replies
  • 814 views
Posted on November 06, 2007 at 13:12

ST712 BSPI clock problem

This topic has been closed for replies.

2 replies

jkim71
jkim71Author
Associate II
November 6, 2007
Posted on November 06, 2007 at 01:59

I am working with STR712 and have BSPI problem

I have set BSPI1,2 as master and there is no clock in data receiving.

There is clock when sending, but not receiving.

I have used BSPI_BufferSend() when sending and this function only seems to write data in TX buffer and clock occurs.

I have used BSPI_BufferReceive() when receiving and this function seems to read data in RX buffer but clock does not occur.

I didn't used interrupt and set /CS of ADC and called BSPI_BufferReceive()

712 and ADC are isolated by photocoupler.

Pleaes help me solve this problem

Thanks.

jpeacock2
Associate III
November 6, 2007
Posted on November 06, 2007 at 13:12

For an SPI bus the bus master must always source the clock, for send or receive. In order to read data from a peripheral you must generate clocks by writing dummy data to the SPI bus, then reading back the data as each dummy byte is sent out. the value of the dummy byte varies depending on the peripheral chip targeted, but in general a null byte (0x00) will work.

You should check if your peripheral supports simultaneous read and write. SPI allows for data to be clocked out and in at the same time.

Jack Peacock