This article gives possible reasons why the communication between your host controller and an Anybus CompactCom 40 (ABCC40) fails.
APPLICABLE PRODUCTS
Anybus CompactCom 40 in SPI mode
ABCC driver ('Host Application Example Code', HAEC)
ISSUE
After connecting the SPI lines MOSI/MISO/SCLK/CS of the ABCC40 with your controller and integrating the ABCC driver in your application, the initialization stops and never reaches WAIT_PROCESS state.
POSSIBLE CAUSES
- Have you included a low value pull-down resistor (between 1k0 and 2k2) on the ABCC40 OM3 pin?
Otherwise, the SPI operating mode won't be recognized by the ABCC40.
- Are you using 3- or 4-wire SPI? Using a 3-wire SPI connection towards the ABCC40, only SPI mode 3 is supported, whereas 4-wire supports both modes 0 & 3 (this is regarding the SPI clock and phase polarity).
Make sure to configure the SPI master of your controller accordingly.
- Have you implemented your system adaptation function ABCC_SYS_SpiSendReceived() in such a way that it sends out the MOSI while at the same time the MISO frame is clocked in (similar to a shift register application)?
By no means should the ABCC40 be interrogated by a MOSI telegram while expecting the answer in a later MISO response telegram.
- In case you observe a MISO response from the ABCC40 in a logic analyzer, but the initialization is still not possible: maybe you forgot to include the pnDataReadyCbf() call at the end of your ABCC_SYS_SpiSendReceive() system adaptation function.
This call notifies the ABCC driver to process the received MISO frame.
ADDITIONAL INFO
Information on SPI clock polarity and phase