This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC1310: RF IQ SAMPLE SIGNAL NOISE

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310

Hello,

I followed TI CC1310 IQ sample turtorial. I use one CC1310 Launchpad as receiver and one CC1310 SDK as transmitter. I use SMART RF studio to continuously trasnsmit unmodulated signal. with setting showed below:

At the receiver end, I buffered 900 I/Q sample pairs and send them to my computer for further analysis. According to TI support's previous answer, I set my receiving symbol rate to be 2k Baud per second which should perform I/Q ADC's sample rate at 8000 SPS due to the four times oversampling.

Then I plot them out and see some peaks on my I/Q signal. Since I was transmitting unmodulated signal which should be DC? Is it correct? 

1. Could you please tell why do I get these peaks?

I also tried to set IF frequency to be 0 and I got the following:

  

2. Could you kindly please tell me if the carrier is directly downconverted to baseband or IF for the I/Q samples? 

3. Could you please send me the CC1310 receiver detailed chain block diagram? Is there an AGC in the receiver chain and how could I control it? I didn't find it in the tech manual.

4. Last question, according to  its says that "receiver do not sample I/Q data at the same time". If so, how could you deal with the I/Q phase bias in your protocols? 

  • A few things:
    - Have you tried to go through www.ti.com/.../swra571.pdf step by step and have you plotted the IQ from this and gotten expected results?
    - You should get a DC if the frequency error between the TX and RX side is zero. If not you will get a angular movement that represent the frequency error.
    - Are you sure that you read the correct memory locations?
    - The IQ numbers are 2'complement, it looks like you have not plotted them as that.
    - For low datarates, use a IF since the DC component is large.

    What do you want to implement in the end?
  • Hello TER,

    I have gone through the pdf step by step and 100% sure that it works well if it is receiving fake counter numbers. To avoid I/Q buffer being overwritten during UART transmission. I tried that I/Q symbol rate could not be set to be greater than 600. According to 

    If I set symbol rate to be 600, my I/Q ADC sample rate would be 2400 Hz. Could you confirm her calculation? 

    Fake counter number:

    However, I still could not get any DC which is what I expected. The I/Q signal I got was even more noisy! 

    Here is my SMART RF studio Transmitter setting:

    And this is my receiver frequency setting:

    rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup =
    {
        .commandNo = 0x3807,
        .status = 0x0000,
        .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .modulation.modType = 0x1,
        .modulation.deviation = 0x00,
        .symbolRate.preScale = 0xF,
        .symbolRate.rateWord = 0x7D0,
        .rxBw = 0x20,
        .preamConf.nPreamBytes = 0x4,
        .preamConf.preamMode = 0x0,
        .formatConf.nSwBits = 0x20,
        .formatConf.bBitReversal = 0x0,
        .formatConf.bMsbFirst = 0x0,
        .formatConf.fecMode = 0x0,
        .formatConf.whitenMode = 0x0,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x1,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0xA73F,
        .pRegOverride = pOverrides,
        .centerFreq = 0x0364,
        .intFreq = 0x8000,
        .loDivider = 0x05,
    };

    I tried deviation 25kHz and 0Hz which showed the same result.

    1. Could you please tell me what is my frequency error between my TX and RX?

    2. Could you please help me to confirm that you could get DC with two CC1310 Launchpad on your side? 

    3. By default in your example code, you set ".intFreq = 0x8000,". Does it mean you have involved IF in the example?

    What I want to implent is very simple. Basically, I just would see that if I'm sending unmodulated signal, I could see contant quadrature(I/Q) amplitude and phase.

    Could you please answer my previous questions? 

    Thank you so much!

  • How do you send these fake counter numbers?

    You have to measure the frequency error you have between your boards since they are a function of the frequency tolerance of the xtal you are using.
  • HAve you tested with the settings from the design note as well, not only the counter values? I just did a test where I used the settings for 12.5 kbps (deviation = 6.25 kHz) and RX BW to 39 kHz.

    I first sent a modulated signal from SmartRF Studio: Plots below:

    IQ Samples:

    Eye Diagram:

    Unmodulated, IQ Samples:

    Before you start to change the RF settings (data rate etc.) you need at least be able to reproduce this. This is tested with two LPs and SmartRF Studio as the transmitter.

    I did also did some testing on 2 kbps data rate. When I looked at the eye diagram, it did not look very good if looking at many samples (1500), but you clearly saw an eye when plotting fewer samples. I talked to the modem designer that has made the patch and he said the following:

    "Although it is possible to program 8kHz IQ sample rate, we recommend to use higher sample rate in receive.

    We typically target 20 ppm frequency tolerance for crystal system, and with a sample rate of 8 kHz, the highest

    possible frequency that can be represented is 4 kHz. This make the initial frequency estimation much more

    complex. Please note that when I tested 8 khz sample rate, it looks like the API  has a minor truncation error

    in the Fractional Resampler settings for this low sample rate, which does not give exact 8 ksps sample rate.

    This is not a problem as long as you have a simple symbol tracker unit, like a simple zero crossing receiver."

     

    Please note that the IQ patch is something we provide "as is" with the dcumentation in the application note. It is meant to be used with the settings provided in SmartRf Studio and we will not give our more information about the device, other than what is already in the TRM.

     

    Siri

  • Dear Siri,

    Thank you so much for your detailed reply!

    1. I would like to reproduce your experiment on two Launchpads. Could you please send me your smart radio Transmitter setting for the unmodulated signal transmission? 

    2. Could you kindly please tell me why do you get sinoid I and Q samples when you are sending unmodulated signal? Does it mean that no matter you do frequency modulation or not, you will also send a fixed frequency baseband signal rather than DC? If so, could I change this frequency?

    Thank you so much!

  • Siri is OOO today.

    1) When you used SmartRF Studio, did you go to the cont. TX tab and select unmodulated carrier? That should be sufficient.

    2) You will have phase rotation (sinus) if you have frequency offset between the boards. Try to adjust the frequency on one of the boards to a point where the frequency delta between them is as close to zero as possible.
  • Hello TER,

    1. I tried what you said. However, I never got pure sinsoid wave like what Siri sent.  In most cases, my I/Q signal were saturated.

    2. I know frequency offset will influence phase. But, my question is about baseband signal when you are sending unmodulated signal. Could you kindly please take a look at my questions?

    Thanks so much!

  • Part Number: LAUNCHXL-CC1310

    Hello,

    Following the suggested setting in this related question. I use one CC1310 Launchpad and Smart RF studio for Transmitting. By following all the steps in I/Q example tutorial, I built I/Q example receiver on another CC1310 lauchpad.

    Accoding to Ti support's reply, if I set my symbol rate to 12.5kBaud and deviation to 6.25k and send unmodulated signal, I should get two sine wave represents my I and Q. However, I could not get those waves with the same setting. Regardless of the frequency offset of the two LP, it seems that my I/Q signals are all clipped off. I tested packet receiving with the same hardware placement and RF setting which worked very well.

    Could you kindly please tell me that which parameter(AGC Gain or DC bias?) should I change to solve this problem?

    Thank you so much!

       

  • Hi Jianlin,

    I merged your latest question into this thread since it is just a continuation on the same topic.

    Can you provide some more background on what you are doing and why you need this information?

    Thanks,
    Fredrik
  • Hello Fredrick,

    We want to use two cc1310 to work as transmitter and receiver. And we want to measure the dielectric boundry changing which could bahave as amplitude modulation on your carrier.

    That's why I do want to know more details about your receiver ADC and I/Q information. We would like to find a lightweight replacement of our sdr platform.

    Could you kindly please answer my previous questions regarding on the clipping and baseband tuning?

    Thanks so much!

  • If you look at Siri's I and Q plots they go from -50 to 50, yours are going from 0 to 2, indicating that something is wrong with your code. Have you used the code from the appnote as is and looked at the I and Q values?
  • Hello TER,

    I normalized my I/Q with 4096 which is the ADC resolution (12 bits). That is why I think that there's something wrong with my receiver gain control or DC bias. My I/Q value are around 4095 and 1 which I think clipping happened there.

    Thanks so much.
  • - Where do you get that the ADC in the RF path is 12 bit from?

    - When Siri tested the data stated in 2.1.2 in www.ti.com/.../swra571.pdf was used.

    If you have further issues, please show that you have followed the app note to the letter and how you take out the IQ data and plot them.
  • Dear TER,

    Thank you so much for your patience. I'm sorry for continuous bothering you but I did follow the steps and settings in you IQ tech reference. If you don't believe, please check my attached files in where modification should be made according to your tech reference. The difference between my Rx code and Siri's Rx code is that Siri would like to use a external HWI(pushing button) to trigger UART but mine is to use a SWI when iSample Buffer is filled. I think it won't affect I/Q data. 

    My Tx setting is following:

    Symbol rate and deviation are all set to default value according to:

    To use external SMA antenna, I use a MXFR01JA1000 connector and followed your LP design suggestion( Remove R12 and mount 0 Ohm R13):

    However, I could not get a pure sine wave. It looks like I get a constant frequency DC variation/ drifting on my I/Q samples. I repeat experiment many times and they all have the same issue. But when I used Smart RF studio continuous Rx, I didn't see any drifting on RSSI. For justification, I attached my .mat file:

    Could you kindly please tell me why this constant DC drifting happens on I/Q samples? That is the reason why I asked all these AGC, DC bias and baseband frequency questions.

    Thanks again and look forward for your kindly reply.

    I Q sample.txt
    11	4074	88	561	823	830	800	268	465	1611	1356	4089	3352	2746	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2775	3791	455	1309	2047	2047	2047	843	528	654	617	621	602	574	513	431	360	274	191	80	4036	3955	3884	3791	3689	3590	3530	3514	3486	3464	3489	3524	3557	3616	3710	3801	3866	3941	4070	120	239	319	393	471	535	594	626	631	617	601	568	502	412	302	196	110	27	4042	3906	3765	3708	3646	3560	3496	3473	3462	3467	3495	3540	3593	3682	3794	3856	3962	4072	56	200	345	401	451	544	602	617	629	626	597	552	489	415	331	233	134	14	3973	3878	3797	3688	3595	3550	3519	3483	3466	3476	3506	3534	3585	3656	3748	3854	3979	10	129	209	292	370	461	538	586	615	632	630	603	555	517	441	345	250	114	4090	4004	3907	3803	3705	3622	3558	3500	3470	3462	3465	3502	3560	3602	3669	3774	3878	3979	4060	50	158	310	424	475	512	563	613	628	626	609	563	497	429	349	255	137	4087	3983	3874	3781	3701	3648	3587	3514	3474	3465	3463	3474	3540	3616	3682	3777	3880	3963	4010	4	166	292	383	462	536	583	611	627	632	616	579	521	454	404	314	158	25	4037	3935	3838	3760	3678	3586	3525	3487	3465	3467	3495	3526	3555	3625	3719	3824	3942	4034	12	135	240	337	444	506	559	605	627	632	617	590	534	462	400	305	184	102	0	3947	3824	3769	3682	3597	3537	3499	3470	3459	3470	3493	3556	3617	3666	3790	3923	4009	4089	124	270	348	410	463	534	595	623	628	609	587	566	506	391	289	200	112	34	4013	3856	3735	3642	3612	3579	3502	3464	3465	3471	3493	3537	3592	3700	3875	3937	3962	4091	141	275	368	409	470	555	606	621	631	608	558	518	488	428	329	219	96	4035	3936	3883	3802	3687	3576	3533	3496	3469	3463	3470	3509	3562	3607	3677	3799	3937	4029	11	111	221	308	377	473	550	606	627	627	611	582	556	479	368	296	204	96	4089	3963	3834	3717	3656	3620	3551	3485	3460	3469	3483	3505	3552	3612	3696	3782	3873	4020	39	125	244	354	421	476	551	604	625	627	608	596	573	471	342	253	149	73	10	3959	3839	3772	3699	3622	3540	3488	3471	3465	3476	3505	3547	3617	3708	3790	3861	3967	14	97	186	298	389	469	543	597	623	629	622	600	551	496	408	285	184	98	15	3997	3867	3804	3710	3590	3529	3500	3480	3466	3473	3498	3537	3588	3673	3803	3922	3974	4050	95	227	289	346	451	547	595	621	632	623	605	550	468	414	376	248	93	4089	4027	3979	3841	3685	3586	3529	3501	3477	3465	3470	3510	3563	3597	3652	3733	3829	3927	4075	131	225	307	385	449	526	587	619	633	616	594	564	502	428	345	214	66	4077	4002	3907	3810	3712	3612	3548	3513	3480	3462	3473	3506	3563	3636	3698	3770	3885	4021	63	115	170	310	411	488	568	611	630	635	630	598	544	489	404	315	206	57	4089	4004	3868	3760	3678	3606	3545	3499	3471	3465	3480	3510	3564	3628	3691	3781	3887	4032	58	106	213	350	438	509	554	593	628	629	604	570	533	479	389	314	241	115	4047	3907	3831	3777	3693	3589	3532	3491	3468	3469	3490	3528	3573	3632	3718	3812	3906	4044	68	131	243	345	407	496	581	619	630	628	616	591	536	453	403	310	155	78	4060	3918	3825	3749	3669	3593	3541	3499	3472	3471	3485	3510	3554	3617	3682	3777	3948	4065	29	124	236	326	416	484	544	602	631	628	603	572	543	477	374	299	225	108	4085	3967	3867	3752	3673	3635	3550	3486	3466	3465	3476	3494	3558	3645	3705	3766	3882	3988	8	132	228	322	437	509	554	596	618	631	620	580	544	473	383	302	166	89	55	4008	3856	3736	3644	3601	3560	3507	3469	3463	3481	3508	3542	3633	3736	3816	3909	3968	4060	113	255	355	427	514	586	619	626	630	619	584	538	474	370	273	187	82	4062	3940	3847	3758	3668	3578	3514	3483	3469	3465	3483	3521	3569	3625	3707	3834	3945	4044	46	153	280	361	435	537	584	600	626	631	609	570	520	431	337	280	177	44	4034	3953	3829	3705	3624	3560	3506	3476	3463	3471	3497	3525	3584	3669	3750	3860	3979	4074	72	205	351	424	462	520	575	611	630	625	601	572	513	416	325	230	127	34	4000	3860	3768	3709	3631	3566	3527	3488	3463	3464	3499	3551	3608	3691	3753	3809	3944	4095	109	202	317	412	461	512	577	613	632	624	584	544	503	466	381	216	98	47	4019	3869	3821	3747	3626	3565	3513	3474	3463	3474	3493	3521	3590	3685	3747	3849	3991	16	80	130	262	407	470	524	583	622	633	623	616	567	476	423	362	258	132	0	4006	3883	3766	3696	3645	3566	3498	3476	3467	3466	3485	3525	3584	3669	3753	3825	3942	4091	113	199	274	372	457
    4022	166	3494	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2048	2129	2780	3669	630	1452	2047	2047	2047	2047	2047	2047	2047	2047	2047	2047	2047	2047	158	3892	3976	3946	3977	3908	3827	3731	3630	3576	3529	3491	3470	3465	3476	3498	3539	3610	3714	3815	3848	3924	12	184	273	331	413	500	559	590	615	632	620	586	548	495	425	336	213	99	4081	3955	3889	3819	3709	3615	3537	3490	3472	3462	3461	3495	3554	3593	3651	3762	3894	3972	4053	80	200	303	387	474	558	587	616	635	632	596	533	491	442	315	202	144	55	4013	3890	3787	3694	3618	3557	3507	3475	3463	3475	3499	3536	3609	3704	3769	3842	3940	4027	98	234	287	368	454	531	585	622	632	619	597	562	515	433	332	240	148	20	4012	3912	3792	3729	3649	3562	3515	3476	3461	3469	3492	3534	3598	3672	3759	3882	3992	4059	67	220	338	397	463	544	592	620	629	630	611	548	469	415	371	281	164	56	4014	3916	3809	3703	3629	3568	3515	3480	3462	3471	3502	3544	3603	3647	3721	3847	3957	4040	31	118	291	419	479	546	595	619	629	633	613	563	504	431	335	248	167	63	4054	3953	3839	3737	3654	3608	3548	3486	3462	3466	3485	3517	3558	3621	3722	3820	3927	4038	66	196	282	335	423	511	572	614	631	633	614	588	533	454	383	291	187	97	4077	3951	3861	3758	3661	3603	3543	3489	3469	3461	3481	3522	3553	3620	3706	3793	3880	4005	20	105	200	323	417	466	550	610	627	634	616	573	530	482	430	331	216	121	4058	3919	3860	3809	3720	3598	3532	3497	3473	3463	3470	3508	3575	3657	3689	3726	3902	4089	14	68	190	294	385	487	587	612	617	630	617	569	514	481	424	301	176	134	41	3938	3791	3728	3691	3629	3555	3502	3470	3468	3483	3500	3533	3620	3737	3803	3892	4006	4091	84	226	341	400	471	553	608	628	630	623	591	555	504	418	305	166	75	4057	3935	3849	3792	3692	3583	3537	3500	3471	3463	3476	3518	3588	3638	3679	3777	3934	4069	84	166	230	323	409	489	550	591	626	633	618	583	524	473	417	307	187	109	4065	3917	3880	3829	3681	3562	3517	3486	3468	3464	3481	3515	3552	3603	3677	3800	3921	3997	17	133	222	315	411	497	552	586	612	627	624	600	554	495	418	314	206	89	4073	3985	3901	3796	3703	3615	3534	3491	3472	3462	3474	3507	3532	3599	3715	3820	3879	3976	35	131	201	298	379	470	558	609	620	630	623	588	561	527	441	318	215	102	4071	3989	3913	3788	3671	3617	3587	3521	3469	3465	3467	3474	3521	3610	3719	3813	3881	3956	4069	110	242	344	391	450	517	573	610	628	620	591	551	501	445	346	240	133	4089	3952	3876	3811	3712	3629	3562	3502	3467	3463	3473	3494	3529	3594	3688	3776	3852	3961	4090	109	227	339	432	492	541	598	629	629	624	608	550	486	403	284	173	87	6	4010	3887	3770	3692	3609	3542	3499	3466	3460	3471	3506	3560	3622	3698	3786	3896	4005	28	147	238	341	428	485	548	599	626	631	623	589	528	457	373	307	212	80	4039	3911	3823	3757	3686	3601	3547	3513	3474	3468	3491	3522	3549	3613	3716	3811	3922	4012	23	179	282	353	429	506	564	603	626	629	619	580	528	480	383	241	125	59	4081	3966	3867	3763	3658	3604	3550	3483	3464	3470	3489	3523	3568	3631	3710	3794	3881	4002	80	173	238	328	410	480	544	610	632	630	616	585	540	475	410	317	177	61	4064	3918	3822	3772	3684	3587	3537	3505	3474	3463	3478	3506	3569	3623	3662	3785	3926	4029	32	124	201	328	445	500	539	594	627	632	618	592	542	455	378	303	206	138	48	3993	3846	3770	3683	3593	3540	3488	3468	3466	3472	3507	3579	3653	3700	3759	3870	3996	8	139	234	309	426	521	568	604	620	631	623	578	527	469	368	236	134	101	6	3959	3855	3766	3677	3584	3522	3491	3467	3464	3480	3513	3562	3628	3732	3846	3936	4035	54	159	263	348	423	496	575	618	630	632	614	566	524	458	330	250	207	87	4028	3923	3819	3727	3633	3556	3525	3487	3462	3463	3476	3522	3596	3671	3756	3863	3958	4057	104	213	279	372	468	532	586	623	632	630	596	525	470	430	358	264	172	39	3980	3887	3821	3725	3617	3548	3505	3473	3461	3470	3508	3551	3591	3667	3743	3808	3918	4060	81	202	326	408	488	536	566	612	633	626	600	546	479	434	369	257	152	24	3979	3852	3772	3713	3662	3592	3503	3467	3463	3470	3502	3521	3573	3672	3747	3847	3964	4079	107	196	271	381	483	530	581	624	633	629	623	573	486	426	351	252	121	4070	3989	3944	3824	3681	3624	3578	3515	3481	3462	3467	3500	3554	3605	3649	3753	3888	3960	4023	33	164	278	374	468	533	572	612	633	623	602	570	515	442
    

    0407.smartrf_settings.c
    
    //*********************************************************************************
    // These settings have been generated for use with TI-RTOS and cc13xxware
    //
    // Generated by SmartRF Studio version 2.6.0 (build #8)
    // Tested for TI-RTOS version tirtos_simplelink_2_21_00
    // Device: CC1310 Rev. 2.1
    // 
    //*********************************************************************************
    
    
    //*********************************************************************************
    // Parameter summary
    // Address: off 
    // Address0: 0xAA 
    // Address1: 0xBB 
    // Frequency: 868.00000 MHz
    // Data Format: Serial mode disable 
    // Deviation: 6.250 kHz
    // Packet Length Config: Variable 
    // Max Packet Length: 128 
    // Packet Length: 20 
    // RX Filter BW: 39 kHz
    // Symbol Rate: 12.50000 kBaud
    // Sync Word Length: 32 Bits 
    // TX Power: 14 dBm (requires define CCFG_FORCE_VDDR_HH = 1 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual)
    // Whitening: No whitening 
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
    #include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
    #include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
    #include <ti/drivers/rf/RF.h>
    #include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_genfsk.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_mce_iqdump.h)
    #include DeviceFamily_constructPath(rf_patches/rf_patch_rfe_genfsk.h)
    #include "smartrf_settings.h"
    
    
    // TI-RTOS RF Mode Object
    RF_Mode RF_prop =
    {
        .rfMode = RF_MODE_PROPRIETARY_SUB_1,
        .cpePatchFxn = &rf_patch_cpe_genfsk,
        .mcePatchFxn = &rf_patch_mce_iqdump,
        .rfePatchFxn = &rf_patch_rfe_genfsk,
    };
    
    // Overrides for CMD_PROP_RADIO_DIV_SETUP
    static uint32_t pOverrides[] =
    {
    
        // Setting the mode of operation to IQFifoBlind
        MCE_RFE_OVERRIDE(1,0,2,1,0,0),
        // override_synth_prop_863_930_div5.xml
        // Synth: Set recommended RTRIM to 7
        HW_REG_OVERRIDE(0x4038,0x0037),
        // Synth: Set Fref to 4 MHz
        (uint32_t)0x000684A3,
        // Synth: Configure fine calibration setting
        HW_REG_OVERRIDE(0x4020,0x7F00),
        // Synth: Configure fine calibration setting
        HW_REG_OVERRIDE(0x4064,0x0040),
        // Synth: Configure fine calibration setting
        (uint32_t)0xB1070503,
        // Synth: Configure fine calibration setting
        (uint32_t)0x05330523,
        // Synth: Set loop bandwidth after lock to 20 kHz
        (uint32_t)0x0A480583,
        // Synth: Set loop bandwidth after lock to 20 kHz
        (uint32_t)0x7AB80603,
        // Synth: Configure VCO LDO (in ADI1, set VCOLDOCFG=0x9F to use voltage input reference)
        ADI_REG_OVERRIDE(1,4,0x9F),
        // Synth: Configure synth LDO (in ADI1, set SLDOCTL0.COMP_CAP=1)
        ADI_HALFREG_OVERRIDE(1,7,0x4,0x4),
        // Synth: Use 24 MHz XOSC as synth clock, enable extra PLL filtering
        (uint32_t)0x02010403,
        // Synth: Configure extra PLL filtering
        (uint32_t)0x00108463,
        // Synth: Increase synth programming timeout (0x04B0 RAT ticks = 300 us)
        (uint32_t)0x04B00243,
        // override_phy_rx_aaf_bw_0xd.xml
        // Rx: Set anti-aliasing filter bandwidth to 0xD (in ADI0, set IFAMPCTL3[7:4]=0xD)
        ADI_HALFREG_OVERRIDE(0,61,0xF,0xD),
        // override_phy_gfsk_rx.xml
        // Rx: Set LNA bias current trim offset to 3
        (uint32_t)0x00038883,
    
        //HW_REG_OVERRIDE(0x52B4, 0x070D),
        // Rx: Freeze RSSI on sync found event
        HW_REG_OVERRIDE(0x6084,0x35F1),
        // override_phy_gfsk_pa_ramp_agc_reflevel_0x1a.xml
        // Tx: Configure PA ramping setting (0x41). Rx: Set AGC reference level to 0x1A.
        HW_REG_OVERRIDE(0x6088,0x411A),
        // Tx: Configure PA ramping setting
        HW_REG_OVERRIDE(0x608C,0x8213),
        // override_phy_rx_rssi_offset_5db.xml
        // Rx: Set RSSI offset to adjust reported RSSI by +5 dB
        (uint32_t)0x00FB88A3,
        // TX power override
        // Tx: Set PA trim to max (in ADI0, set PACTL0=0xF8)
        ADI_REG_OVERRIDE(0,12,0xF8),
    	// Set to avoid internal FIFO overflow when running the IQ Dump Patch
    	(uint32_t)0x001082C3,
        (uint32_t)0xFFFFFFFF,
    
    };
    
    
    // CMD_PROP_RADIO_DIV_SETUP
    // Proprietary Mode Radio Setup Command for All Frequency Bands
    rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup =
    {
        .commandNo = 0x3807,
        .status = 0x0000,
        .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .modulation.modType = 0x1,
        .modulation.deviation = 0x19,
        .symbolRate.preScale = 0xF,
        .symbolRate.rateWord = 0x2000,
        .rxBw = 0x20,//20,
        .preamConf.nPreamBytes = 0x4,
        .preamConf.preamMode = 0x0,
        .formatConf.nSwBits = 0x20,
        .formatConf.bBitReversal = 0x0,
        .formatConf.bMsbFirst = 0x0,
        .formatConf.fecMode = 0x0,
        .formatConf.whitenMode = 0x0,
        .config.frontEndMode = 0x0,
        .config.biasMode = 0x1,
        .config.analogCfgMode = 0x0,
        .config.bNoFsPowerUp = 0x0,
        .txPower = 0xA73F,
        .pRegOverride = pOverrides,
        .centerFreq = 0x0364,
        .intFreq = 0x8000,
        .loDivider = 0x05,
    };
    
    // CMD_FS
    // Frequency Synthesizer Programming Command
    rfc_CMD_FS_t RF_cmdFs =
    {
        .commandNo = 0x0803,
        .status = 0x0000,
        .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .frequency = 0x0364,
        .fractFreq = 0x0000,
        .synthConf.bTxMode = 0x0,
        .synthConf.refFreq = 0x0,
        .__dummy0 = 0x00,
        .__dummy1 = 0x00,
        .__dummy2 = 0x00,
        .__dummy3 = 0x0000,
    };
    
    // CMD_PROP_TX
    // Proprietary Mode Transmit Command
    rfc_CMD_PROP_TX_t RF_cmdPropTx =
    {
        .commandNo = 0x3801,
        .status = 0x0000,
        .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .pktConf.bFsOff = 0x0,
        .pktConf.bUseCrc = 0x1,
        .pktConf.bVarLen = 0x1,
        .pktLen = 0x14, // SET APPLICATION PAYLOAD LENGTH
        .syncWord = 0x930B51DE,
        .pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    // CMD_PROP_RX
    // Proprietary Mode Receive Command
    rfc_CMD_PROP_RX_t RF_cmdPropRx =
    {
        .commandNo = 0x3802,
        .status = 0x0000,
        .pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
        .startTime = 0x00000000,
        .startTrigger.triggerType = 0x0,
        .startTrigger.bEnaCmd = 0x0,
        .startTrigger.triggerNo = 0x0,
        .startTrigger.pastTrig = 0x0,
        .condition.rule = 0x1,
        .condition.nSkip = 0x0,
        .pktConf.bFsOff = 0x0,
        .pktConf.bRepeatOk = 0x0,
        .pktConf.bRepeatNok = 0x0,
        .pktConf.bUseCrc = 0x1,
        .pktConf.bVarLen = 0x1,
        .pktConf.bChkAddress = 0x0,
        .pktConf.endType = 0x0,
        .pktConf.filterOp = 0x0,
        .rxConf.bAutoFlushIgnored = 0x0,
        .rxConf.bAutoFlushCrcErr = 0x0,
        .rxConf.bIncludeHdr = 0x1,
        .rxConf.bIncludeCrc = 0x0,
        .rxConf.bAppendRssi = 0x0,
        .rxConf.bAppendTimestamp = 0x0,
        .rxConf.bAppendStatus = 0x1,
        .syncWord = 0x930B51DE,
        .maxPktLen = 0x0, // MAKE SURE DATA ENTRY IS LARGE ENOUGH
        .address0 = 0xAA,
        .address1 = 0xBB,
        .endTrigger.triggerType = 0x1,
        .endTrigger.bEnaCmd = 0x0,
        .endTrigger.triggerNo = 0x0,
        .endTrigger.pastTrig = 0x0,
        .endTime = 0x00000000,
        .pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
        .pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
    };
    
    
    
    7215.rfPacketRx.c
    /***** Includes *****/
    /* Standard C Libraries */
    #include <stdlib.h>
    #include <xdc/runtime/Error.h>
    #include <ti/sysbios/BIOS.h>
    
    /* TI Drivers */
    #include <ti/drivers/rf/RF.h>
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/UART.h>
    #include <ti/sysbios/knl/Semaphore.h>
    
    /* Driverlib Header files */
    #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h)
    
    /* Board Header files */
    #include "Board.h"
    
    /* Application Header files */
    #include "RFQueue.h"
    #include "smartrf_settings/smartrf_settings.h"
    
    /***** Defines *****/
    
    /* Packet RX Configuration */
    #define NUMBER_OF_SAMPLE_PAIRS 300 /*Setting NUMBER_OF_SAMPLE_PAIRS to 300 means that
                                        each data entry used must have room for 300 x
                                        3 bytes.*/
    
    #define DATA_ENTRY_HEADER_SIZE 8  /* Constant header size of a Generic Data Entry */
    #define MAX_LENGTH             30 /* Max length byte the radio will accept */
    #define NUM_DATA_ENTRIES       2  /* NOTE: Only two data entries supported at the moment */
    #define NUM_APPENDED_BYTES     2  /* The Data Entries data field will contain:
                                       * 1 Header byte (RF_cmdPropRx.rxConf.bIncludeHdr = 0x1)
                                       * Max 30 payload bytes
                                       * 1 status byte (RF_cmdPropRx.rxConf.bAppendStatus = 0x1) */
    
    
    #define PARTIAL_RX_ENTRY_HEADER_SIZE 12
    #if defined(__TI_COMPILER_VERSION__)
    #pragma DATA_ALIGN (rxDataEntryBuf1, 4);
    static uint8_t rxDataEntryBuf1[PARTIAL_RX_ENTRY_HEADER_SIZE +
    (NUMBER_OF_SAMPLE_PAIRS * 3)];
    #pragma DATA_ALIGN (rxDataEntryBuf2, 4);
    static uint8_t rxDataEntryBuf2[PARTIAL_RX_ENTRY_HEADER_SIZE +
    (NUMBER_OF_SAMPLE_PAIRS * 3)];
    #endif
    rfc_dataEntryPartial_t* partialReadEntry1 = (rfc_dataEntryPartial_t*)&rxDataEntryBuf1;
    rfc_dataEntryPartial_t* partialReadEntry2 = (rfc_dataEntryPartial_t*)&rxDataEntryBuf2;
    rfc_dataEntryPartial_t* currentReadEntry = (rfc_dataEntryPartial_t*)&rxDataEntryBuf1;
    
    #define NUMBER_OF_BUFFERS 5
    static uint16_t iSamples[2+NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS];
    static uint16_t qSamples[2+NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS];
    
    /***** Prototypes *****/
    static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e);
    
    /***** Variable declarations *****/
    static RF_Object rfObject;
    static RF_Handle rfHandle;
    
    /* Pin driver handle */
    static PIN_Handle ledPinHandle;
    static PIN_State ledPinState;
    
    /* Define UART handle*/
    static UART_Handle uart;
    static UART_Params uartParams;
    
    /* Define Semaphore handle*/
    static Semaphore_Struct printSemaphore;
    static Semaphore_Handle printSemaphoreHandle;
    
    /* Buffer which contains all Data Entries for receiving data.
     * Pragmas are needed to make sure this buffer is 4 byte aligned (requirement from the RF Core) */
    #if defined(__TI_COMPILER_VERSION__)
    
    #elif defined(__IAR_SYSTEMS_ICC__)
    #pragma data_alignment = 4
    static uint8_t 
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      MAX_LENGTH,
                                                      NUM_APPENDED_BYTES)];
    #elif defined(__GNUC__)
    static uint8_t 
    rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
                                                      MAX_LENGTH, 
                                                      NUM_APPENDED_BYTES)] 
                                                      __attribute__((aligned(4)));
    #else
    #error This compiler is not supported.
    #endif
    
    /* Receive dataQueue for RF Core to fill in data */
    static dataQueue_t dataQueue;
    
    static uint8_t* packetDataPointer;
    int packetDelay;
    
    
    /*
     * Application LED pin configuration table:
     *   - All LEDs board LEDs are off.
     */
    PIN_Config pinTable[] =
    {
        Board_PIN_LED2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    #if defined Board_CC1352R1_LAUNCHXL
        Board_DIO30_RFSW | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,
    #endif
    	PIN_TERMINATE
    };
    
    /***** Function definitions *****/
    
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
        packetDelay = 1;
    
        /* Open LED pins */
        ledPinHandle = PIN_open(&ledPinState, pinTable);
        if (ledPinHandle == NULL)
        {
            while(1);
        }
    
        partialReadEntry1->length = (NUMBER_OF_SAMPLE_PAIRS * 3) + 4;
        partialReadEntry1->config.type = DATA_ENTRY_TYPE_PARTIAL;
        partialReadEntry1->status = DATA_ENTRY_PENDING;
        partialReadEntry2->length = (NUMBER_OF_SAMPLE_PAIRS * 3) + 4;
        partialReadEntry2->config.type = DATA_ENTRY_TYPE_PARTIAL;
        partialReadEntry2->status = DATA_ENTRY_PENDING;
        partialReadEntry1->pNextEntry = (uint8_t*)partialReadEntry2;
        partialReadEntry2->pNextEntry = (uint8_t*)partialReadEntry1;
        dataQueue.pCurrEntry = (uint8_t*)partialReadEntry1;
        dataQueue.pLastEntry = NULL;
    
        iSamples[0] = 65534;
        iSamples[1] = 73;
        qSamples[0] = 65534;
        qSamples[1] = 81;
    
        // UART Init
        UART_init();
    
        /* Create a UART with data processing off. */
        UART_Params_init(&uartParams);
        uartParams.writeDataMode = UART_DATA_BINARY;
        uartParams.readDataMode = UART_DATA_BINARY;
        uartParams.readReturnMode = UART_RETURN_FULL;
        uartParams.readEcho = UART_ECHO_OFF;
        uartParams.baudRate = 115200;
    
        uart = UART_open(Board_UART0, &uartParams);
        if (uart == NULL) {
                while (1);
        }
    
        /* Initialize print semaphore */
        /* Create a semaphore for UART Print */
        Semaphore_Params params;
        Error_Block eb;
    
        /* Init params */
        Semaphore_Params_init(&params);
        Error_init(&eb);
    
        /* Create semaphore instance */
        printSemaphoreHandle = Semaphore_create(0, &params, &eb);
    
    
        /* Modify CMD_PROP_RX command for application needs */
        /* Set the Data Entity queue for received data */
        RF_cmdPropRx.pQueue = &dataQueue;
    
        /* Request access to the radio */
        rfHandle = RF_open(&rfObject, &RF_prop, 
                           (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
    
        /* Set the frequency */
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        /* Enter RX mode and stay forever in RX */
        RF_CmdHandle  rxHandle  = RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,
                                                   RF_PriorityNormal, &callback,
                                                   RF_EventRxEntryDone);
    
    //    while(1){
        Semaphore_pend(printSemaphoreHandle, BIOS_WAIT_FOREVER);
        RF_cancelCmd(rfHandle, rxHandle, 0); // abort abruptly
    
        UART_write(uart, iSamples, sizeof(iSamples));
        UART_write(uart, qSamples, sizeof(qSamples));
    
    
        while(1);
    
    
    }
    
    static uint16_t index = 0;
    void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
    if (e & RF_EventRxEntryDone)
    {
        // Toggle pin to indicate RX
        PIN_setOutputValue(ledPinHandle,
        Board_PIN_LED2,!PIN_getOutputValue(Board_PIN_LED2));
        // Get a pointer to the first IQ sample byte
        packetDataPointer = &currentReadEntry->rxData;
        //---------------------------------------------------------------------------
        // Implement code for handling the IQ data
        // In this example, I and Q data are simply copied into two separate array
        {
            uint16_t i;
            // IQ Sample Handling
            for (i = index; i < (NUMBER_OF_SAMPLE_PAIRS + index); i++)
            {
                iSamples[2+i] = (((*(packetDataPointer + 1)) << 8) |
                        (*packetDataPointer)) & 0x0FFF;
                qSamples[2+i] = (((*(packetDataPointer + 2)) << 8) |
                        (*(packetDataPointer + 1))) >> 4;
                packetDataPointer += 3;
    
            }
        }
    
        index += NUMBER_OF_SAMPLE_PAIRS;
        if (index == (NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS))
        {
            index = 0;
            if(packetDelay > 3){
                Semaphore_post(printSemaphoreHandle);
            }
            packetDelay++;
        }
        //---------------------------------------------------------------------------
        currentReadEntry->status = DATA_ENTRY_PENDING;
        currentReadEntry = (rfc_dataEntryPartial_t*)currentReadEntry->pNextEntry;
        }
    }
    

  • - Do you plot only the first data entry? The reason Siri used a button is that it takes some time until the data is stable. You should try to plot data entry 10 as an example.

    - Could you share the matlab script you are using?
  • Dear TER,

    Thanks for your reply. I also tried the following:

    1) Send SWI and plot data entry 10, 100 ,1000.

    2) Use HWI(push button) and plot corresponding data entry.

    3) repeat 1 and 2 with cable connected two Launchpad.

    They all showed the same result as before which means there is a DC drifting on my I/Q samples. When you get stable I/Q samples, are you using the Launchpad on board stripline antenna? I think that may be the only hardware set-up difference. I also bought two brand new launch pad and this issue could not be resolved.

    Please check my attached MATLAB code. Please run the script before you debug your ccs code.

    MATLAB code.rar

    Thanks a lot!

  • Hello Siri,

    Could you please send me your rfpacketRx.c file and smartRFsetting.c file? I would like to make a final test on my launchpads before I give up on it. I could not resolve the changing dc offset issue which I posted above with the same setting as you and TRM recomended. 

     I just could not find out the source of this DC drifting on every half I/Q sample sine wave period. Is it possible that in direct down-convertion senario receiver ADC reference voltage is not set at a proper value and when voltage reach the upper bound of Rx ADC, reference voltage would be pulled down to lower bound?

    I have been stucked at this point for really a long time and I totally understand that you could not provide anymore information beyond your tech reference. With limited knowledge of your rf receiver design, the only thing I could do is posting questions here and seeking for suggestion.

    Thank you so much and look forward for you reply.