2007-11-06 04:12 AM
2007-11-05 04:59 PM
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.2007-11-06 04:12 AM
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