5
« on: July 27, 2018, 08:04:47 PM »
Hi everyone,
I'm using the FT813 in my project and it has lots of images is around 66 on a screen but almost all is small picture or symbol.
I'm using the crc calculating avoid errors while transferring. However, I'm confused a point in the datasheet, it says that read to ıf CommandWriteAddress + 12 to get the calculated crc value. Well, if this command address is 4092, I still have to read +12, so 4092+12? If yes, then, will there be an overflow in command buffer? Or should the (4092+12)-4096=8th address be read?
Furthermore, I'm using a shadow command buffer and inserting the commands to it. Then they are sent to FT813 via DMA as the following example. Each transfer before, I read the reg_cmd_write and add the new commands to it. However, it read 2048 from reg_cmd_write and need 3012 bytes commands. What can I do at this point? Should I add 3012 to 2048 that is equal to 5060? Or clear the cmd_write and cmd_read registers?
uint32_t cmdBufferWr= ft800memRead32(REG_CMD_WRITE);
sCommands.Instruction = 0x00;
sCommands.InstructionMode = QSPI_INSTRUCTION_NONE;
sCommands.AddressMode = QSPI_ADDRESS_4_LINES;
sCommands.DdrMode = QSPI_DDR_MODE_DISABLE;
sCommands.AddressSize = QSPI_ADDRESS_24_BITS;
sCommands.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
sCommands.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;
sCommands.AlternateBytes = 0x00;
sCommands.Address = (cmdBufferWr + RAM_CMD) | 0x800000;
sCommands.DataMode = QSPI_DATA_4_LINES;
sCommands.NbData = ulCommandIndex;
sCommands.DummyCycles = 0;
sCommands.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
sCommands.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
s_transfer_reg_to_ftdi.b_state = IMAGE_TRANSFERRING_FTDI;
__FTDI_SELECT();
vDelayUs(300);
HAL_QSPI_Command(&hqspi, &sCommands, HAL_QPSI_TIMEOUT_DEFAULT_VALUE);
HAL_QSPI_Transmit_DMA(&hqspi, (uint8_t*) &ucCmdBuffer[0]);