- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
config:
my test code:
SPIM_3_Start();
while(1)
{
SPIM_3_TxEnable(); //使能SPI发送
SPIM_3_ClearRxBuffer(); //清空Rx缓存
a = SPIM_3_GetRxBufferSize();
SPIM_3_WriteByte(READ_SECOND_REG); //发送地址
SPIM_3_TxDisable();
while(!(SPIM_3_ReadStatus() & SPIM_3_STS_TX_FIFO_EMPTY));
b = SPIM_3_GetRxBufferSize();
//使能SPI接收
c = SPIM_3_GetRxBufferSize();
while(!(SPIM_3_ReadStatus() & SPIM_3_STS_RX_FIFO_NOT_EMPTY));
e = SPIM_3_GetRxBufferSize();
d = SPIM_3_ReadByte(); //读出数据
sprintf(msg,"TIME: %d %d %d %d %d",a,b,c,d,e);
draw_debug(msg,0,0);
}
who can tell me that the datas i get from DS1302 always are 0xff ???
thank you!!!
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another issue I just see:
Before switching from transmit to receive you check the TxStatus for FiFo empty, but you should wait for complete transmission since the pin will switch to input before the transfer is complete.
Bob