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
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?
 

vhn

Member level 4
Joined
Sep 20, 2006
Messages
76
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,288
Activity points
1,803
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
 

Kabanga

Member level 4
Joined
Oct 4, 2007
Messages
76
Helped
7
Reputation
14
Reaction score
1
Trophy points
1,288
Activity points
1,720
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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top