This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRV8705S-Q1EVM: Analogue spi read and write issue

Part Number: DRV8705S-Q1EVM

Hi team,

Here's an issue from the customer may need your help:

Regarding the issue, here's a new question:

When simulating spi, does read and write data need to be done in the same cycle? The test code for the specific analogue spi is as follows.

And now with the drv8705 register read back (0x00, 0x01, 0x2), there is no error. But the motor is still high on both sides. The customer would like to know how to resolve this problem?

The test code for reading the drv8705 register by analogue spi is as follows:

uint8 SPI_Simulate_DataHandle(uint16 u16outputdata, uint16 *pinputdata)
{
uint8 u8_rtn_val;
uint8 u8writedata;
uint8 u8readdata;
uint16 u16readdata;

u8_rtn_val = 0;
u8writedata = 0;
u8readdata = 0;
u16readdata = 0;

if(NULL_PTR != pinputdata)
{
#if 1
/* set sclk low */
SPI_Simulate_SetSCLK(0);//PTP &= (~0x40);
SPI_Simulate_Delayus(SPI_SIMULATE_DELAY_TIME); /* delay 1.5us */
/* set cs high */
SPI_Simulate_SetCS(1);//PTP |= 0x20;

SPI_Simulate_Delayus(SPI_SIMULATE_DELAY_TIME); /* delay 1.5us */
/* set cs low */
SPI_Simulate_SetCS(0);//PTP &= ~(0x20);

for(uint8 i=0; i<16; i++)
{
/* set sclk high */
SPI_Simulate_SetSCLK(1);//PTP |= (0x40);
u8writedata = (u16outputdata >> (15 - i)) & 0x01;
if(0x01 == u8writedata)
{
PTP_PTP0 = 1;
}
else
{
PTP_PTP0 = 0;
}
//SPI_Simulate_Delayus(2); /* delay 1.5us */
//u8writedata = ((uint8)(u16outputdata << (15 - i))) & 0x01;
//SPI_Simulate_OWHandle(u8writedata);//PTP |= u8writedata;
SPI_Simulate_Delayus(SPI_SIMULATE_DELAY_TIME); /* delay 1.5us */
/* set sclk low */
SPI_Simulate_SetSCLK(0);//PTP |= (~0x40);

SPI_Simulate_ORHandle(&u8readdata);//u16readdata |= PTT >> 7;
u16readdata |= ((uint16)u8readdata) << i;
SPI_Simulate_Delayus(SPI_SIMULATE_DELAY_TIME); /* delay 1.5us */
}
*pinputdata = u16readdata;
/* set cs high */
SPI_Simulate_SetCS(1);//PTP |= 0x20;
#else

SPI_Simulate_WriteData(u16outputdata);

SPI_Simulate_Delayus(SPI_SIMULATE_DELAY_TIME); /* delay 1.5us */
SPI_Simulate_ReadData(pinputdata);
#endif
}
else
{
/* input parameter is null */
u8_rtn_val = 1;
}
return u8_rtn_val;
}

The values of the drv8705 register 0x00, 0x01, 0x02 read back through the oscilloscope are as follows: (No error shows from the oscilloscope)

IN1/EN, motor terminal A,B, as follows:

(From top to bottom, the Chinese in the figure means: 1. Motor terminal A. 2. IN1/EN input PWM: 8KHz. 3.Motor terminal B.)

Could you help check this case? Thanks.

Best Regards,

Cherry