2024-10-10 01:44 AM - last edited on 2024-10-10 02:59 AM by SofLit
Hello,
In pair with the LT8722 I use Stm32 Nucleo U5A5ZJQ and TECF1S Peltier device (7v and 1.2A)
Currently as I am trying to communicate with it through the SPI. Just basic status acquisition packet 32bit transmit and 32bit receive. I send 0xF0001491 and there are three cases.
void SPI_Status_Acquisition(uint8_t command, uint8_t register_address)
{
printf(" Status Acquisition Packet \n");
memset(spirx_buffer, 1, sizeof(spirx_buffer));
//Command 8bit -> Address 8bit -> CRC 8bit -> 0xXX ignored 8bit
spitx_buffer[0] = command; // 1 byte for command
spitx_buffer[1] = register_address; // 1 byte for register address
spitx_buffer[2] = 0x00; // 1 byte for CRC
spitx_buffer[3] = 0x91; // 1 byte of padding data
crc = calculate_crc(spitx_buffer, 2);
spitx_buffer[2] = crc;
HAL_Delay(100);
HAL_GPIO_WritePin(TEC_CS_GPIO_Port, TEC_CS_Pin, GPIO_PIN_RESET);
HAL_Delay(100);
HAL_SPI_TransmitReceive(&hspi1, spitx_buffer, spirx_buffer, 4, HAL_MAX_DELAY);
HAL_Delay(100);
HAL_GPIO_WritePin(TEC_CS_GPIO_Port, TEC_CS_Pin, GPIO_PIN_SET);
HAL_Delay(100);
}
Regarding the other SPI packets Data write and Data read, I am lost, because it is 64bit receive and 64bit transmit. How can I send or receive through SPI at once, per one action whole 64 bits? Dividing it into array and sending one-by-one just make it think that every cell is an individual packet.
Thank you.
2024-10-10 02:59 AM - last edited on 2024-10-10 03:10 AM by Andrew Neil
Hello @Metyus ,
Please kindly use </> button to paste your code. See this post for posting tips. I'm editing your post.
Thank you for your understanding.
2024-10-10 03:19 AM - edited 2024-10-10 03:22 AM
So this: https://www.analog.com/en/products/lt8722.html
@Metyus wrote:Just basic status acquisition packet
So this:
@Metyus wrote:there are three cases.
- CS pin cycle (high->low->high->low->high) is done twice...
- CS pin cycle (high->low->high) is done...
- CS pin cycle (high->low->high)...
No, there is only 1 case shown in that diagram:
Have you used an oscilloscope or logic analyser to verify what is actually happening on the wires?
Have you checked out AD's demo software: https://www.analog.com/en/products/lt8722.html#evaluation-kit ?
2024-10-10 05:08 AM
Hello Andrew.
Yes, you are right with the device - LT8722 of Analog Devices. Three cases described are all related to the Status Acquisition packet behaviour. Each one of them gives different results, most important is that CASE 2, which is one in datasheet does not acknowledge communication (last C3 byte), while CASE 1 acknowledges my transmission with (A5 byte), but CASE 1 is not exactly what datasheet claims it to be. CASE 3 was a test of use HAL_SPI_TransmitReceive command, which seemed to be fitting to the "packet" concept, but instead it gives (0F byte) meaning rejection, because address is wrong, though address is same as in previous cases. I confirmed the CS behaviour set by me with oscilloscope, yes.
Regarding Linduino Evaluation Kit, I have looked into it, when I started working with LT8722, but it omits many important things in the initialisation process. This is essential in Stm32CUBE and is one of key problems I faced. Linduino Kit is inflexible and I need LT8722 in pair with U5A5ZJQ.
I would appreciate any experience related to controlling the LT8722 with the ST products or software.
Thank you.