2022-03-21 02:18 PM
Hello Guys,
I'm new here and more from the hardware side.
My problem is, I have a SPI ADC (ADS8665) and for it to work, it needs 32bit commands.
So I tried this:
uint8_t buff[4];
buff[0] = 0xC8;
buff[1] = 0x00;
buff[2] = 0x00;
buff[3] = 0xC8;
HAL_SPI_Transmit(&hspi1, buff, sizeof(buff), 1000);
But then the 32bit are sent in 4x 8bit with a delay in between each paket and the ADC does not recognize the command.
can someone help me get rid of these delays?
thanks in advance.
2022-03-21 02:20 PM
Sending 8 bits 4 times is the same as sending 32 bits once. Shouldn't be an issue here.
2022-03-21 02:22 PM
sry the post wasnt fully completed...i edited it
2022-03-21 02:29 PM
Delays are allowed in SPI communication. I don't see CS pin management here. Initialize the CS pin as a GPIO and set low before the transaction and high after.
You can remove the delay by slowing down the clock rate or by using HAL_SPI_Transmit_DMA (with appropriate initialization), but unlikely that's the issue here.
2022-03-21 02:40 PM
The CS is handled before and aknowleged by the adc (the adc pulls a signal to high) so this should be wright the 3rd channel of the oscilloscope pic is the CS Signal it gets pulled low before the transmit…Im going to try the DMA method tomorrow…but if I understood wright, you guys say that it shouldnt be a issue if the 32bit come in one or 4 blocks?