Hi,
I configured the CC1110 to enter in RX mode with a timeout of ~1038uS (WOR_RES = 2, RX_TIME = 0 AND EVENT0 = 32). So my simple test program is basically the following:
enterPM1(); RFIF &= 0xDF; radioRxModeOn(); while (!(RFIF & 0x20) && !radioReadyPkt()); if (RFIF & 0x20) RED_LED = 1; else { GREEN_LED = 1; }
and then I repeat this forever.
To make this device "hear" the packets, it must be in RX mode while other radio must be send a preamble in this interval, right?
So I'm trying to make a CC1111 send a long preamble (1.1 sec), according to datasheet, just strobing STX without setting any DMA or putting any data on RFD, would be enough, right?
So I did the following, just to see if the CC1110 stuck in the fourth line of the code above.
RFST = STROBE_TX;
while(1);
But it is not working, what am I doing wrong?
Thank you.
Hi
Unfortunately I only have one CC1110 available right now so I could not test exactly what you are trying to do, but I was able to do the following. First I ran my board from SmartRF Studio and used the "RF Device Command" wind to strobe STX. On my receiver board (a CC1120 also running from SmartRF Studio) I was able to see that the CC1110 was transmitting continuously in the "Continuous RX" window. I would therefore recommend that you start by verifying that your TX works by using SmartRF STudio on the receiver side.
Then I used my CC1110 as receiver and ran the following code:
void main(void) { // Choose the crystal oscillator as the system clock and set system clock speed = fRef (fxosc) CLKCON = CLKCON_26_MHZ_XOSC; // Request switch to crystal oscillator while (CLKCON & OSC_BIT); // Wait until the clock switch has occurred SLEEP |= OSC_PD_BIT; // Power down unused oscillator PKTCTRL1 = 0x45; // packet automation control PKTCTRL0 = 0x04; // packet automation control FSCTRL1 = 0x06; // frequency synthesizer control FREQ2 = 0x21; // frequency control word, high byte FREQ1 = 0x62; // frequency control word, middle byte FREQ0 = 0x76; // frequency control word, low byte MDMCFG4 = 0xF5; // modem configuration MDMCFG3 = 0x83; // modem configuration MDMCFG2 = 0x00; // modem configuration DEVIATN = 0x15; // modem deviation setting MCSM0 = 0x18; // main radio control state machine configuration FOCCFG = 0x17; // frequency offset compensation configuration FSCAL3 = 0xE9; // frequency synthesizer calibration FSCAL2 = 0x2A; // frequency synthesizer calibration FSCAL1 = 0x00; // frequency synthesizer calibration FSCAL0 = 0x1F; // frequency synthesizer calibration TEST2 = 0x81; // various test settings TEST1 = 0x35; // various test settings TEST0 = 0x09; // various test settings PA_TABLE0 = 0xC2; // pa power setting 0 VCO_VC_DAC = 0xFD; // current setting from pll calibration module
RFST = STROBE_RX; while (!(RFIF & 0x04)); while (TRUE);
)
I used recommended settings from SmartRF Studio but enabled address recognition to avoid RX overflow (since I am not reading the RFD register) and I set PQT != 0.
I was then able to see that the radio got the PQT interrupt flag set.
I recommend that you start by doing your testing one step at the time. First you should confirm that you are actually sending a preamble. Then you should see that you get your interrupt while in RX (without using Power modes / Sleep timer, RX timeout) etc.
You should then see that you wake up properly from PM1. Remember that your crystal is off in PM1 and must have time to get stable before entering active mode (RX or TX).
BR
Siri
Hi Siri,
I tested your code, but the maximum time it takes at line while (!(RFIF & 0x04)); is about 2 second, but it varies for less. Even if the cc1111 with SmartRF is sending nothing.
i am able to receive packets when returning from PM1 mode, but staying in RX until the end of the packet. This code confirm this, the green led goes high:
enterPM1();RFIF &= 0xDF;radioRxModeOn(); while (!(RFIF & 0x20) && !radioReadyPkt());if (RFIF & 0x20) RED_LED = 1;else { // packet received, rx timeout not reached GREEN_LED = 1;}
The board is sending the packet is the same of the test above, connected with smartrf studio
Hi Bruno
If you are on a channel with a lot of other RF activities, it will not take long to receive a "preamble". If this is the case you simply need to increase the PQT.
I am not sure that I understand what you are trying to test/achieve, so I would appreciate if you can explain in more details what you are trying to do and how it fails, and maybe I will be able to help.
Just another comment. What data rate are you transmitting at?
Your application sleeps for 945 ms and are in RX for 1.38 ms. With a data rate of 250 kbps, you will be able to receive 257 bits in the time you are awake, but if your data rate is 1.2 kbps you will only receive 1 bit. What you must make sure when setting the PQT threshold is that you have enough time in RX to reach the threshold and you must also set RX_TIME_QUAL = 1 to avoid terminating RX.
The datarate i'm using is 250kbaud.
RX_TIME_QUAL is 0 here, i'll make some tests with this bit high as you said,
thanks Siri!
The problem was in fact with the RX_TIME_QUAL and PQT bits,
RX_TIME_QUAL is 1 now
PQT are 010
Now when I strobe TX on cc1111 without data, the cc1110 get stuck on that line of my code, consuming more current, until I hit SIDLE strobe on the other device.
What I am trying to do is to make the CC1110 wake up every 1 second from PM1/2 and stay in RX for ~1ms trying to receive some packet. I did not understand another way that the WOR works, like said in datasheet and AN047: "without MCU interaction".
Thank you very much Siri!