uint8 txBuffer[32] = {0};
cc120xSpiWriteTxFifo(txBuffer,sizeof(txBuffer));
trxSpiCmdStrobe(CC120X_STX);
trxSpiCmdStrobe(CC120X_STX);
// Wait for interrupt that packet has been sent.
// (Assumes the GPIO connected to the radioRxTxISR function is
// set to GPIOx_CFG = 0x06)
while(packetSemaphore != ISR_ACTION_REQUIRED);
// Clear semaphore flag
packetSemaphore = ISR_IDLE;
HAL_NVIC_EnableIRQ(EXTI4_IRQn); cc120xSpiReadReg(CC120X_NUM_TXBYTES, &txBytes, 1);
// (Assumes the GPIO connected to the radioRxTxISR function is
// set to GPIOx_CFG = 0x06)
while(packetSemaphore != ISR_ACTION_REQUIRED);
// Clear semaphore flag
packetSemaphore = ISR_IDLE;
HAL_NVIC_EnableIRQ(EXTI4_IRQn); cc120xSpiReadReg(CC120X_NUM_TXBYTES, &txBytes, 1);
question:
1. when i send 1 times, the txBytes is 0x20;
2. when i send 2 times, the txBytes is 0x3f;
3 when i send 3 times, the txBytes is 0x5e;
4. when i send 4 times, the txBytes is 0x7c;
5. when i send 5 times, STX status byte is 0x7f,which denote TX FIFO has over/underflowed.
why the Tx FIFO error? the txBytes is must 0x20 when i have finished send the packet?
Viki Shi:
建议参考CC120X的例程:www.ti.com/…/swrc274
user4766611:
回复 Viki Shi:
谢谢,就是参考的这个example. 想咨询下CC120X_NUM_TXBYTES这个寄存器具体表示的含义,是我说我发送了多少字节数据,如果接收端没有收走的话,这个数据就一直在tx fifo么?
Viki Shi:
回复 user4766611:
你数据发送完后选择什么模式?不同的选择流程不同,这个在用户手册有详细描述—-Figure 2: Simplified State Diagram
www.ti.com/…/swru346b.pdf