2022-06-05 03:01 AM
hello everyone, I have question about SPI. I want to send 5 data repeatedly using hal_spı_transmit() function that means first data that will be send is pointer addres later the value will be send , first data is written to SPI->DR but secondly data and third data aren't written to DR register so I can not make to run the ıntegrate device and can not write to the register of device, actually I want to make the expander of port. If you help me about it, I will be happy really , Thank you!
2022-06-05 09:06 AM
> want to send 5 data repeatedly using hal_spı_transmit() function
How exactly?
> first data is written to SPI->DR but secondly data and third data aren't written to DR register
How do you know that?
JW
2022-06-05 01:51 PM
I try to send 5 data one by one using transmit in order that make configuration setting of mcp23s17 firstly chip select pin is felt to reset later I send my data later chip select pin is risen to set but when I make debug, I can not see each data in DR that means My code usually doesn't run but ıt runs sometimes although my code is correct .
2022-06-05 11:49 PM
My code is correct and I have tried a lot of time but ıt doesn't run, I am about to go crazy, If you can help me, I really will be happy.
2022-06-06 01:11 PM
Can it be that you don't wait until a byte is sent out and write the next one?
2022-06-06 02:08 PM
CS_LOW;
HAL_Delay(50);
HAL_SPI_Transmit(&hspi1, yaz, 1, 100);
HAL_SPI_Transmit(&hspi1, &IOCONADRES, 1, 100);
HAL_SPI_Transmit(&hspi1, IOCONDEGER, 1, 100);
CS_HIGH;
a short part of my code is like this, I have solved this problem but The random number is written into DR register at the moment new problem is this, I have tried to put HAL_Delay() function after each other transmission but the result still is same
If I can solve, I will feel very good
2022-06-06 11:25 PM
Do you mean while(SPI1->SR & SPI_SR_BSY) ?