Hey all,
I am struggling with getting my CC1101 to transmit data. I have set fixed packet length of 2 bytes, and here are the steps I take to achieve a transmit.
CC1101_SIDLE(); // GO INTO IDLE
do {
status=CC1101_read_reg(0x3D);
delay_loop(500);
}
while ((status & 0xFF00) != 0); // Make sure it is idle
CC1101_SFTX(); //CLEAR BUFFER
do {
status=CC1101_read_reg(0x3D);
delay_loop(500);
}
while ((status & 0xFF00) != 0); // Make sure it is idle
CC1101_SCAL(); // CALIBRATE
do {
status=CC1101_read_reg(0x3D);
delay_loop(500);
}
while ((status & 0xFF00) != 0); // Make sure it is idle
CC1101_write_reg(0x3F,0x00); // WRITE DESTINATION ADDRESS 0x00 (BROADCAST)
CC1101_write_reg(0x3F,data1); // PACKET BYTE 1
CC1101_write_reg(0x3F,data2); // PACKET BYTE 1
//HERE I ACTUALLY MAKE SURE TXBYTES IS 3... NOT SHOWN HERE
CC1101_STX(); // STX STROBE
do {
status=CC1101_read_reg(0x3D);
delay_loop(500);
}
while ((status & 0xFF00) != 0); // Make sure it is idle <======= HERE IS THE PROBEL
After filling TX FIFO and issuing STX, the chip never goes back into idle mode and stays in TX Mode. I have CC1101_write_reg(MCSM1, 0x30); so it should go to idle after transmittin. And I don't get any underflow errors in the status byte as the status byte is just 0x20 which means it is in TX. Can you please help me on this?
Thanks!
Anil