Continue to Site

Welcome to EDAboard.com

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.

Stepper motor controlling with SPI interface, PIC18F4580

Status
Not open for further replies.

brunokasimin

Member level 4
Member level 4
Joined
Jun 13, 2008
Messages
70
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,828
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?
 

Re: spi interface

Hi brunokasimin,
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.

Regards,
vhn
 
Re: spi interface

the SSPBUF always contain the received or transmitted data. So, just check that register to check the communication between Master and Slave
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top