Chat freely about anything...

User avatar
By Sean Wang
#96082 Project description:
1.CY8CKIT-059 is Master and ESP8266 mini d1 is Slave.
2.Master communicate with Slave via SPI per 2 seconds and each time the value increases 1.

Question:
I don't know why my slave device always receive "Master : 0".The value doesn't increase in each time.
Attachments
slave_1.JPG
(719 Bytes) Downloaded 34 times
(568.56 KiB) Downloaded 32 times
User avatar
By rooppoorali
#96265 Make sure the SPI interface is properly configured on both devices. Check the pin connections, and ensure that the SPI mode, clock frequency, and data order are all set correctly on both devices. If possible, use a logic analyzer to debug the communication between the two devices.
User avatar
By djlin
#96312 First, check the physical connections between the devices to ensure that the SPI interface is properly connected. Next, review the code for both devices to make sure that the SPI communication settings (such as clock frequency and data mode) are correctly configured.

In the Slave device code, double-check that the SPI interrupt is enabled and that the received data is properly read from the SPI buffer. Also, ensure that the Slave device is properly configured to receive data from the Master device.
User avatar
By eriksl
#96334 I am afraid the only other way left to debug an SPI device is to attach a logic analyser. If anything is incorrect (e.g. too high speed, distortion on the cable, wrong clock or data polarity, mix-up of wires (i.e. MOSI/MISO the wrong way around) there won't be any error message it just doesn't work.