Hi, thank you all for your help.
you have reason, I had a mistake into the next function, so I wrote a wrong address register:
Thank you
you have reason, I had a mistake into the next function, so I wrote a wrong address register:
Quotevoid FT813_memWrite16(u32 ftAddress, u16 ftData16) {Now, all is correct.
s32 i;
u8 cTempAddr[3], cTempData[2];
HAL_StatusTypeDef estat;
cTempAddr[2] = (u8)(ftAddress >> 16) | MEM_WRITE; // Compose the command and address to send
cTempAddr[1] = (u8)(ftAddress >>; // middle byte
cTempAddr[0] = (u8)(ftAddress); // low byte
cTempData[1] = (u8) (ftData16 >>; // Compose data to be sent - high byte
cTempData[0] = (u8) (ftData16); // low byte
FT813_CS_ON;
for (i=2;i>=0;i--) HAL_SPI_Transmit(&FT813_SPI_H,&cTempAddr,1,FT813_SPI_TO); // Send Memory Write plus high address byte
for (i=0;i<2;i++) estat=HAL_SPI_Transmit(&FT813_SPI_H,&cTempData,1,FT813_SPI_TO); // Send data bytes
FT813_CS_OFF;
}
Thank you
; // middle byte