cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Communication Problem with L6474PD drive

MYadw.1
Associate II

To validate the drive L6474PD I was reading the status through getStatus command but the drive is responding with FFFF. I am not understanding to validate the drive through SPI.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Community member​,

from your pictures the L6474 is behaving properly.

If you do not configure the proper clock polarity and phase the communication fails.

You must set CPOL = 1 as above mentioned and CPHA = 1 (the IC updates the out on the falling edge and samples on the rising edge).

I attach a picture of SPI timing diagram [from wikipedia]:

0693W00000DnurkQAB.pngLet me know if with the proper setting solves your problem.

If you feel a post has answered your question, please click "Accept as Solution"

View solution in original post

16 REPLIES 16
Cristiana SCARAMEL
ST Employee

Hi @Community member​ and welcome to the ST Community.

Could you share more details on the hardware/software you are using to evaluate the L6474 IC?

Anyway, during the SPI communication, are all device supply voltages (VS, VREG, VDD) correctly powered?

Let me know your feedback for a better support.

If you feel a post has answered your question, please click "Accept as Solution"
MYadw.1
Associate II

I am using NXP controller for SPI communication with the drive and Keil Software. All the supplies are correct as per the data sheet of the drive.

Cristiana SCARAMEL
ST Employee

Hi @Community member​,

you sent a GetStatus command and received an answer from the device: so I would exclude a problem on the SPI interface.

The device is correctly supplied.

I do not have other info to find the root cause of unexpected behavior.

Could you share more details on your application?

Are you using a custom board and/or custom firmware?

Are you able to perform other commands?

If you feel a post has answered your question, please click "Accept as Solution"
MYadw.1
Associate II

We are using STM drive to control Motor through custom firmware having M4 controller of NXP. With proper supply we have sent different command like Getstatus, Getparam for few of the STM drive registers as mentioned in the data sheet in response we are garbage values other than the expected values (Reset Value).

All the Timing diagrams are met with respect to the drive.

We are not able to figure out what is the problem with it

Hello @Community member​ 

are you using an ST evaluation board or a custom one?

In the second case, could you share the schematic (at least the L6474 part) to check the HW connections?

Concerning to the communication protocol you can refer also to application notes AN4290 for more details.

Let me know if there are some progress in you project.

If you feel a post has answered your question, please click "Accept as Solution"

Hello @Cristiana SCARAMEL​ 

We are using custom one. HW connections are as per recommended.

Drive is behaving in a peculiar way.

Whatever i update in Alarm Register it is reflecting into the status register.

We are not getting the default values.

It will be helpful if you have in example code how read the registers and update the registers

Attaching below the L6474 datasheet page in which it is confusing what is maximum speed of SPI

0693W00000DmMlHQAV.png

Hi @Community member​ 

you can find an example code in the X-CUBE-SPN1 software package.

To better understand, could you share the SPI timing diagram of a command (e.g. GetStatus)?

If you feel a post has answered your question, please click "Accept as Solution"

0693W00000DnD7jQAF.jpgHi @Cristiana SCARAMEL​ 

Attaching screenshot of waveforms for reading status please go through.0693W00000DnD4vQAF.jpg0693W00000DnD7AQAV.jpg0693W00000DnD75QAF.jpg0693W00000DnD6gQAF.jpg

Hi @Community member​,

in your screenshot CS signal (yellow) and CK signal (green trace) you are using clock polarity CPOL = 0.

In the L6474 datasheet the SPI timings diagram (Figure 13) show a CPOL = 1 (a clock which idles at 1, and each cycle consists of a pulse of 0).

Let me know if this solve your problem.

If you feel a post has answered your question, please click "Accept as Solution"