Hello,
I've got a question regarding auto ack.
Here are my register configurations for LBT + auto ack.
Receiver:
// LBT
writeByte = 0x10; cc112xSpiWriteReg(CC112X_PKT_CFG2, &writeByte, 1);
writeByte = 10; cc112xSpiWriteReg(CC112X_AGC_CS_THR, &writeByte, 1);
// TXOFF_MODE = RX
writeByte = 0x38; cc112xSpiWriteReg(CC112X_RFEND_CFG0, &writeByte, 1);
//RX Off mode=TX
writeByte = 0x2E; cc112xSpiWriteReg(CC112X_RFEND_CFG1, &writeByte, 1);
Transmitter:
// TXOFF_MODE = RX
writeByte = 0x38; cc112xSpiWriteReg(CC112X_RFEND_CFG0, &writeByte, 1);
// RXOFF_MODE = RX
writeByte = 0x3F; cc112xSpiWriteReg(CC112X_RFEND_CFG1, &writeByte, 1);
I realized that the transmitter can not receive auto ack packet when it strobes STX only one time.
I am sure of that the receiver receives packet at first time and sends auto ack but the transmitter can not receive first one. When the transmitter sends second time, it receives auto ack packet at this time.
Let me try to explain further:
while(packetSemaphore != ISR_ACTION_REQUIRED);
// Reset packet semaphore
packetSemaphore = ISR_IDLE;
// Packet sent. Radio enters RX automatically to wait for ack. (2)
while(packetSemaphore != ISR_ACTION_REQUIRED);
// Reset packet semaphore
packetSemaphore = ISR_IDLE;
while(packetSemaphore != ISR_ACTION_REQUIRED);
// Reset packet semaphore
packetSemaphore = ISR_IDLE;
If i program the transmitter as above, since it does not receive auto ack, condition remains true forever.
If i add a timeout as below it breaks while loop and try to send more time and transmitter receives auto ack at this time.
exceed = 1;
timeout = 0;
while((packetSemaphore != ISR_ACTION_REQUIRED) && exceed){
timeout++;
if(timeout > 200000){
exceed = 0;}
}
if(exceed == 1)
{
// Reset packet semaphore
packetSemaphore = ISR_IDLE;
}
exceed = 1;
timeout = 0;
// Packet sent. Radio enters RX automatically to wait for ack. (2)
while((packetSemaphore != ISR_ACTION_REQUIRED) && exceed){
timeout++;
if(timeout > 200000){
exceed = 0;}
}
if(exceed == 1)
{
// Reset packet semaphore
packetSemaphore = ISR_IDLE;
}
exceed = 1;
timeout = 0;
while((packetSemaphore != ISR_ACTION_REQUIRED) && exceed){
timeout++;
if(timeout > 200000){
exceed = 0;}
}
if(exceed == 0)
{
goto try_on;
}
else if(exceed == 1)
{
packetSemaphore = ISR_IDLE;
...
Does anyone have any idea?