2023-11-30 03:03 AM
I am using STMCubeIDE for my project.
SPI3 connected with PC10, PC11, and PC12 pins but When I connected the logic analyzer with the PC11 pin while reading TMC5160 register it showed nothing. The pin will be high whatever I do.
I know this thing not give you a full Idea but tell me anything you want I will share it. B-coz I don't know what info will be useful to debug.
2023-11-30 03:20 AM
> When I connected the logic analyzer
Then it sounds like hardware damage, it may be on either side (STM32, target, LA) or all.
SCK works?
You can try to bit-bang some basic protocol to exclude any other influence.
JW
2023-11-30 03:22 AM
Hello @MarkEvens,
Maybe share your SPI3 configuration/ connection with TMC5160 chip
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-30 04:42 AM
Look at reasons why the Slave device isn't responding.
Is there a pin controlling I2C/SPI mode, or how chip select is activated.
Is it always doing this or does it work for a period after the power is cycled. How long and what access patterns?
2023-12-01 02:57 AM
Logic analyzer Image
White -> sck
Second orange -> CS
Red is -> MOSI
Last is -> MISO
2023-12-01 03:00 AM - edited 2023-12-01 03:01 AM
hspi2.Instance = SPI2;
hspi2.Init.Mode = SPI_MODE_MASTER;
hspi2.Init.Direction = SPI_DIRECTION_2LINES;
hspi2.Init.DataSize = SPI_DATASIZE_8BIT;
hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi2.Init.NSS = SPI_NSS_SOFT;
hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi2.Init.TIMode = SPI_TIMODE_DISABLE;
hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi2.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi2) != HAL_OK) {
is_hspi2_initialized = 1;
}
hspi3.Instance = SPI3;
hspi3.Init.Mode = SPI_MODE_MASTER;
hspi3.Init.Direction = SPI_DIRECTION_2LINES;
hspi3.Init.DataSize = SPI_DATASIZE_8BIT;
hspi3.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi3.Init.NSS = SPI_NSS_SOFT;
hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi3.Init.TIMode = SPI_TIMODE_DISABLE;
hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi3.Init.CRCPolynomial = 10;
if (HAL_SPI_Init(&hspi3) != HAL_OK) {
is_hspi3_initialized = 1;
}
This is spi initialization and below is my used pins
2023-12-01 03:03 AM
Only write register is working
2023-12-01 03:58 AM
Thank you everyone for your support.
I found a mistake I am using the TMC5160-BoB module which has two separate supply options one is for the motor and the second is named vcc_io.
So I am trying to read from the module without powering the motor supply pins. That is the main power supply for the module. vcc_io is just for resetting the module it is not providing complete power to module :face_with_tears_of_joy:
So as I powered the motor pins it started working.