2020-08-08 04:05 AM
I send quad data via QSPI. But Transfer is limited to 20 us approx.
At QSPI clock 25 MHz is possible send maximally 240 bytes (480 nibbles).
At clock 12.5 MHz is possible send maximally 120 bytes.
At clock 50 MHz is possible send maximally 480 bytes.
I want send 320 bytes at 25 MHz.
I use NUCLEO-F412ZG and timers TIM2 to TIM4.
TIM4 channel 2 is used for triggering DMA, period is 32 us.
volatile int DMA=0;
volatile int Komp = 1;
void HAL_QSPI_TxCpltCallback(QSPI_HandleTypeDef *hqspi)
{
Komp = 1;
}
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
{
static QSPI_CommandTypeDef cmd;
if(Komp == 1)
{
cmd.InstructionMode=QSPI_INSTRUCTION_NONE;
cmd.Instruction=0;
cmd.AddressMode=QSPI_ADDRESS_NONE;
cmd.Address=0;
cmd.AddressSize=0;
cmd.AlternateByteMode=QSPI_ALTERNATE_BYTES_NONE;
cmd.AlternateBytes=0;
cmd.AlternateBytesSize=0;
cmd.DummyCycles=0;
cmd.DdrMode=QSPI_DDR_MODE_DISABLE;
cmd.DdrHoldHalfCycle=QSPI_DDR_HHC_ANALOG_DELAY;
cmd.SIOOMode=QSPI_SIOO_INST_EVERY_CMD;
cmd.DataMode=QSPI_DATA_4_LINES;
cmd.NbData=240;
HAL_QSPI_SetTimeout(&hqspi,-1);
HAL_QSPI_Command(&hqspi,&cmd,-1);
HAL_QSPI_Transmit_DMA(&hqspi,videoram);
Komp = 0;
}
}