This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
C6743 SPI外接FLASH的映射地址是多少啊??????怎么在数据手册上没看到呢
是的,有数据传输时变低。数据传完后是否变高还是维持低电平,要看SPIDAT1.CSHOLD这位是0还是1?
是0的话,会变高。
是1的话,保持低电平。
您好,我设置的SPIDATA.CSHOLD为0,单步运行程序时用示波器一直观察CS引脚,一直是高电平,无任何变化;但是Run整个程序上时观察CS引脚波形是脉冲形式,有高低电平变化,而且高低电平时间比是1:8,这是为什么呢?
另外,我现在去读Flash的ID,读出来的确一直是0;
statusbuf[0]=spiflash_CMD_RDID;
statusbuf[1]=0;
statusbuf[2]=0;
statusbuf[3]=0;
spiflash_cycle(statusbuf,3);
void spiflash_cycle(Uint8 *buf,Uint16 len)
{
Uint16 i;
/* Clear any old data */
SPI_SPIBUF;
/* spiflash access cycle */
for(i=0;i<=len;i++)
{
// Wait for transmit ready
while( SPI_SPIBUF & 0x10000000 );
if (i == len )
SPI_SPIDAT1 = (SPI_SPIDAT1 & 0x0ffc0000) | buf[i] ;
else
{
SPI_SPIDAT1 = (SPI_SPIDAT1 & 0xffff0000) | buf[i];
}
// Wait for receive data ready
while ( SPI_SPIBUF & ( 0x80000000 ) );
/* Read 1 byte */
buf[i] = SPI_SPIBUF;
}
}
您好,我现在发送读FLASH ID命令,ID可以正常读出,但是我发送 写使能命令,再读状态寄存器,状态寄存器显示写使能命令没有执行,擦除命令更没反应,不知道到底是什么原因吗??