The problem for dual SPI output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

The problem for dual SPI output

954 次查看
JAY_tang
Contributor I

I use FC9 SPI as the master device. Send 24 clocks by writing three 8-bit data to the FIFO. The picture below is the clock waveform when sending.

JAY_tang_0-1644891353770.jpeg

But when I utilize both FC9 SPI and FC3 SPI in the same way, there is a long time gap between 3 8-bit data transmissions.

JAY_tang_1-1644891416392.jpeg

Below is part of my code

while (1)
{

if((SPI_GetStatusFlags(EXAMPLE_SPI_MASTER) & kSPI_TxEmptyFlag)&&VCC_discharge_flag)
{
EXAMPLE_SPI_MASTER->FIFOWR = 0x74e0008;
EXAMPLE_SPI_MASTER->FIFOWR = m | 0x74e0000;
EXAMPLE_SPI_MASTER->FIFOWR = 0x75e00FC;
m = m + 11;
}

if(m > 0xEE)
{
VCC_discharge_flag=0;
}

if((SPI_GetStatusFlags(EXAMPLE_SPI_MASTER_VCCQ) & kSPI_TxEmptyFlag)&&VCCQ_discharge_flag)
{
EXAMPLE_SPI_MASTER_VCCQ->FIFOWR = 0x7470008;
EXAMPLE_SPI_MASTER_VCCQ->FIFOWR = n | 0x7470000;
EXAMPLE_SPI_MASTER_VCCQ->FIFOWR = 0x75700FC;
n = n + 11;
}

if(n > 0xEE)
{
VCCQ_discharge_flag=0;
}

}

 

 

0 项奖励
回复
2 回复数

941 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Dear Tang

I have read your code, the control part of the FIFOWR register are 0x0x074E, 0x074E and 0x075E, the EOF(End of Frame) bit is NOT set, delay time is not inserted, I think the control code are correct.

From the spi clock signal waveform on the scope, it appears that the square-waveform   clock signal becomes a sine signal, I suppose the SPI clock signal(SCK) frequency is too high, which highlights the gap between two bytes.

Pls try to reduce the spi clock frequency.

Hope it can help you

BR

XiangJun Rong

 

0 项奖励
回复

951 次查看
JAY_tang
Contributor I

I hope someone can help me!!!!!!!!Thanks

0 项奖励
回复