本帖最后由 donsbin 于 2016-9-18 11:44 编辑
目前采用SPI串行通信,F051主频最快也就48M。目前采用硬件SPI.SPI二分频24M,计算下
(1/24000000)*2*8*320*240 = 52ms
感觉我自己刷一次屏至少100ms,每次刷一次屏都会很明显闪烁一下。 SPI_InitStructure.SPI_Direction = SPI_Direction_1Line_Tx;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b;//SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;//sck - h
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;//
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(TFT_SPI, &SPI_InitStructure);
// SPI_RxFIFOThresholdConfig(TFT_SPI, SPI_RxFIFOThreshold_QF);
SPI_Cmd(TFT_SPI, ENABLE); /* TFT_SPI enable */
uint8_t SPI__SendByte(uint8_t byte)
{
/* Wait until the transmit buffer is empty */
while(SPI_I2S_GetFlagStatus(TFT_SPI, SPI_I2S_FLAG_TXE) == RESET)
{
}
/* Send the byte */
SPI_SendData8(SPI1, byte);
// while(SPI_I2S_GetFlagStatus(TFT_SPI, SPI_I2S_FLAG_TXE) == RESET)
// {
// }
return 0;
}
刷屏速度慢,还占用时间。所以采用DMA来刷屏,发现刷新速度更慢。
听同行说起,他们用DMA来刷屏(320*480 SPI通信),用的也是F051的片子,刷屏肉眼根本感觉不出来。我不知道怎么实现,求帮忙
|