Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
i'm doing a project called stepper motor controlling with SPI interface.Master is a PIC18F4580 and the slave is TMC239(IC Motor Controller).How to know that there is a communication between the microcontroller and the slave?
As with every SPI interface, first you need to check whether Master is generating the clock pulses according to your defined frequency. Use an oscilloscope to check all the waveforms (CLK, MOSI and CS). The chip select should be active while doing the communication.
Go through the slave datasheet and find out if there are any specific sequence for its initialization. Check whether there are any general purpose registers. Then send a command (or the sequence described by slave datasheet) on SPI lines and monitor the MISO pin on Master. If everything is OK, you should be receiving the response from the slave.
You can read the value in the SPI register to verify whether you are getting correct response from the slave.