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.

GC5016, power measure problem

Hi,

I'am using GC5016 as DDC, a I want measure the power level. All works fine, but the measuring is not running. I readed some tips from datasheet:

Example using a read of the msb to fire one shot:

1. Sync integration counter
2. Wait for ready bit to be 1 (8 clocks or less depending on sync source)
3. Read MSB of power (also fires one shot to clear ready bit) and ignore it.
4. Wait for ready bit to be 1
5. Read power LSB
6. Read power MSB
7. Check to be sure missed bit is not set
8. Go to step 4

but i dont know, what does mean step 1 - sync integration counter. I get always zerros values from power measurement data registers.

 

Thank you.

  • Hello,

     

    In Figure 11 of the GC5016 datasheet the Integration timer determines how often the microprocessor bus registers that read the I^2+Q^2 integration counter are updated.  In your description, if the

    microprocessor registers are 0, it is possible that the registers have not been written, or the integration timer has not started.  I have attached an example GC5016 program file, and power measurement

    script.   There are several places in the datasheet, that need to be setup to use the power meter:

       a) Table 6 - the synchronization source that is used for fir_sync, should also be used for the pwr_mtr_sync.

       b) Table 7 in the data sheet can be used to setup the sync_mode, pwr_mtr_on = 1 can be used to help configure the power meter.

       c)  Page 0x13,x33,x53,x73 register 0x1a,0x1b,0x1c, 0x1d are needed for each DDC channel setup AND

            Page 0x14, 0x34, 0x54, 0x74 register 0x15 is need to set pwr_mtr_sync field to fir_sync value

              

                reg 0x1d - set in I or Q words for integration time, each channel has a setup register

                reg 0x15 - need to set pwr_mtr_sync to fir_sync value

     

        d) in my example, I read the value 2x in each channel, and use the result if they are the same.  If the two values are different, any read cycle is used.

             note this just read asynchronously, it does not try to use the one shot.

     

    I hope this helps

    Radio Joe

                

           

     

     

    gc5016_pwrmtrex.zip
  • Hello Radio Joe,

    Thank you for your answer, I have not find any wrong setting yet, so I attached my program file. Please, could you check it? 

    GC5016 project

    With Regards

    Ondrej

     

     

     

     

  • Hello Ondrej,

    Can you resend your post, I can't find your attachment.

    Thanks

    RadioJoe

     

     

  • I uploaded file on another server: http://kvetakov.net/~karri/Filtr_BW2MHz_CF140MHz.zip

    Thank you.

    Ondrej

  • Hello Ondrej,

    I have made some modifications to your file, and using the current version of GC Studio 2.8.1023.0, I was able to get the Power Meter output.

    I have attached a zip file with the modified file.  Please review the cust5016pgm_comments.txt to view the changes, and running the script file to

    configure and read the power meter registers. 

    You will need to contact your local TI Field Application Engineer, or Technical Sales Representative, to have them get an update to the GC Studio

    software program for you.  You can try the version you are using, the script language tool works in later versions.  You need to also have a foldername

    C:\Temp for the script to generate a power meter file. 

    There is additional information on configuring the GC5016, under the TI webpage, GC5016 Configuration Guide. 

    Please run the newer project file, and tell me if it works for your application.

    Regards,

    Radio Joe

     

     

    gc5016_customerpwrmtr.zip
  • Hello Joe,

    thank you for you post. I have some trouble with new version of GC Studio. Previsou version had my colegue. Could you plese post me generated .pgm file to test new project version?

    Thank you

    Ondrej

  • Hello Ondrej,

    I am sorry you are having trouble with GC Studio.  If you can take a screen-picture of the error message, and send it to us, we may be able to suggest a solution.

    In the attached zip file, I have built the project using the Tools Menu -> Export Device Programming file.  The gc5016 programming file name is 'gc5016_ddc_pwrmtr_m1.pgm'

    you can also use the cmd5016 tool, external to GC Studio.  When you make a project in GC Studio, the file 'projectname'_cmd5016Input.txt is generated by GC Studio, and then

    passed to the cmd5016 tool, with a coefficient PFIR file. 

    You also need to run the GC Script, GC5016_PwrMtr.scrgc101 after the GC Studio project to get the Power Meter readout.  The project folder 'C:\Temp\' must be available on your

    computer to use this script command. 

    Regards,

    Joe Quintal

     

    gc5016pwrmtr_081209.zip
  • Hello Joe,

    problem with GC Studio was solved. There was some wrong path and settings, but my problem with power measurement stil be here. Please chceck my ideas:

    1) I have power_meter_sync set to 4 (one shot). For channel A it wil be page 0x14, register 0x15, bits 9-11.

    2) I must set pover measure period, I do this in initial configutration, later I dont set this period.

    3) For measurement I am writing 0x0400 to register 0x1c, page 0x13 (oneshot by read MSB)

    4) I read MSB (one shot)

    5) I wait for ready bit 15 in register 0x1C, page 0x13

    6 I read LSB (0x1a) and MSB (0x1b) of power meter

    7) I get 0x000 for both :(

    Have you any Idea, what I do wrong?

    I am not using development board. I am using my own board, so I do not able use the script. But I mean, that this must working...

    With Regard

    Ondrej

  • Hello Ondrej,

    The GC5016 power meter software one shot was not used in the configuration I sent you.  I just configurer the power meter and read it several times, and store the value when it has been read the same 2x in a row.  I will look for an example with the one shot, but I suggest you try to implement reading the power meter.  and using the setup that I gave you, without the power meter one shot.   In the example I sent:

       a) setup channel power meter

          set page register

           write 0, to 0x1c

           write integration count, to 0x1d

       b)  read channel power meter

          set page register

          read 0x1a - low power meter1

          read 0x1b - high power meter 1

          read 0x1a - low power meter2

          read 0x1b - high power meter 2

          if power meter 1 = power meter 2 (within 1%) then store reading, otherwise reread

    note: in my case, I do clear the status, and set the integration count each time I read the power meter. 

    Please look at the GC5016 PowrMtr.scrgc101, the WriteDevice, and ReadDevice functions are what you need to do with your processor.

    Regards,

    Radio Joe

     

     

     

  • Hello Joe,

    I saw yout .tbl file, and i found pwr_mtr_synt set to 4. I was thinking, that this settings is uset to one shot, but is possible, that I was understand datasheet wrong... I am not using your configuration file, because, function of my GC is in another way. But, my configuration work good on development board. I tryed run your script, and I get right result from power meter.

    When I using my own board (not development board), I get good result on DDC output, but still zerros from power meter. I am used you script as template for writing firmware. But still zerro power [:(]

    I am reading power from channel A. I have splitted I and Q result. A for Q, B for I.

    my code:

    // read PowerMeter
    char ReadPower(unsigned int* powerh, unsigned int* powerl, unsigned int* status)
    {
        // if all is ok, return 1
        char reval = 1;

        GC5016_WriteGlobalRegister(0x02, 0x13);           
        GC5016_WriteGlobalRegister(0x1c, 0x0000);
        GC5016_WriteGlobalRegister(0x1d, 0x4000);

        *powerl = GC5016_ReadGlobalRegister(0x1a);
        *powerh = GC5016_ReadGlobalRegister(0x1b);
        *status = GC5016_ReadGlobalRegister(0x1c);

        return reval;
    }

    The biggest problem is, that I do not understand, what mean: "1. Sync integration counter".

    With Regars

    Ondrej

  • I tryed set power meter to test mode, and I get value 0x0203 (high) and 0x0000 (low) for A channel, and 0xE1D0 (high) fot B,C,D . I am not able to find correct test values in datasheet...

  • Hello Ondrej,

    The power meter test mode, is for factory testing.  It is not a user test. 

    Set the Power meter integration count to 0x4000.

    Set the pwr_mtr_sync to the same value as fir_sync

    Don't use the powr meter oneshot, ready, or missed, just read the power meter registers 2x. 

    In splitIQ mode, the power meter is split between the I (A) and Q (B) values.  You would need the read both channels and add the result.

    You would also need to make sure that the integration count is the same for the pair of channels. 

    The pwr_mtr_sync (table 51 in the datasheet), needs to be set for each DDC channel, ideally to the same value as fir_sync.  This can be checked in your

    cmd5016 input file, and the .tbl output file.  Synchronizing the start of a power meter integration count, is done with this sync. 

    In your GC5016 board, input a tone that can be down converted to an inband tone with no filter attenuation (in passband of PFIR).  Looking in the .anl file,

    record the gain_lsb setting.  In checking the DDC output, note the peak level of your tone input.  If you divide the peak I and Q output, by the (gain_lsb /  4096),

    this should be the peak IQ value at the power meter.  If you have a single tone the peak to average is 3db. 

    The integration count for the I and Q channels, is the total number of IQ samples.  Read the power meter count 2x, to see if the values are similar.  If they are

    you can correct the average of the I^2+Q^2 / count + 1 for input tone level.  

    Regards,

    Radio Joe

     

     

     

     

     

  • Hello Joe,

    is fir_sync and pwr_mtr_sync value set to 4 correct? I don't understand very well to effect of value 4 for pwr_mtr_sync.

    Than you

    Ondrej

  • Hello Ondrej,

     

    The pwr_mtr_sync is used to initialize the power meter integration logic.  A value of 4 in the sync is to allow the Software controlled one shot to initialize the logic.

    The sync_mode and sync selections need to be compatible.   Section 16.8 and 16.9 in the GC5016 datasheet discuss synchronization.  Table 5 shows that the value of '4'

    for the pwr_mtr_sync, fir_sync, cic_sync is to select the software one shot to synchronize the DDC functions.

    Regards,

    Radio Joe

  • Thank you Joe,

    please could check it my method?

    First, in GC Studio, I generate GC_Pgm.gcprg file (attachement), I use my own utility and generate C source file (attachement).

    Next, in hardware inicialisation by my ATMEGA code I call GC5016_Init() which go through while field and get item zerro as address, item one as data, item two as address, item tree as data etc... It seems, that inicialisation works fine, filtering is ok...

    Next, when user want see value of power, I call ReadPower() function with consequent content:

    // read PowerMeter
    char ReadPower(unsigned int* powerh, unsigned int* powerl, unsigned int* status)
    {
        // if all is ok, return 1
        char reval = 1;

        GC5016_WriteRegister(0x02, 0x13);           
        GC5016_WriteRegister(0x1c, 0x0000);
        GC5016_WriteRegister(0x1d, 0x4000);

        GC5016_WriteRegister(0x02, 0x33);           
        GC5016_WriteRegister(0x1c, 0x0000);
        GC5016_WriteRegister(0x1d, 0x4000);

        GC5016_WriteRegister(0x02, 0x13);           

        *powerl = GC5016_ReadRegister(0x1a);
        *powerh = GC5016_ReadRegister(0x1b);
        *status = GC5016_ReadRegister(0x1c);

        return reval;
    }

    but powerl and powerh is still zerro. GC5016_WriteRegister function works fine, I use this function in GC inicialisation and filtering is OK. GC5016_ReadRegister function works fine too, when I want read some another register, I read previous written value.

    Please could you check my method (progress), that is correct?

    I attached while C library for GC (attachement)

    All atachemet are linked to third-party server.

    Thank you Ondrej

  • Thank you Joe,

    please could check it my method?

    First, in GC Studio, I generate GC_Pgm.gcprg file (attachement), I use my own utility and generate C source file (attachement).

    Next, in hardware inicialisation by my ATMEGA code I call GC5016_Init() which go through while field and get item zerro as address, item one as data, item two as address, item tree as data etc... It seems, that inicialisation works fine, filtering is ok...

    Next, when user want see value of power, I call ReadPower() function with consequent content:

    // read PowerMeter
    char ReadPower(unsigned int* powerh, unsigned int* powerl, unsigned int* status)
    {
        // if all is ok, return 1
        char reval = 1;

        GC5016_WriteRegister(0x02, 0x13);           
        GC5016_WriteRegister(0x1c, 0x0000);
        GC5016_WriteRegister(0x1d, 0x4000);

        GC5016_WriteRegister(0x02, 0x33);           
        GC5016_WriteRegister(0x1c, 0x0000);
        GC5016_WriteRegister(0x1d, 0x4000);

        GC5016_WriteRegister(0x02, 0x13);           

        *powerl = GC5016_ReadRegister(0x1a);
        *powerh = GC5016_ReadRegister(0x1b);
        *status = GC5016_ReadRegister(0x1c);

        return reval;
    }

    but powerl and powerh is still zerro. GC5016_WriteRegister function works fine, I use this function in GC inicialisation and filtering is OK. GC5016_ReadRegister function works fine too, when I want read some another register, I read previous written value.

    Please could you check my method (progress), that is correct?

    I attached while C library for GC (attachement)

    All atachemet are linked to third-party server.

    Thank you Ondrej

  • Hello,

    The 'sync integration counter' - is to set the pwr_mtr_sync value for this DDC channel to the startup sync source for fir_sync.  These are shown in table

    51 of the GC5016 data sheet.

    The power meter method described in your post, power meter one shot, can't be tested on the TI EVM, as there is no local DSP/uprocessor.

    We suggest that you setup the pwr_mtr_integ count for the number IQ samples*2 -1 tha are desired.  Set the pwr_mtr_sync value, clear the pwr_mtr_status,

    and read the power LSB and MSB registers.  In the split IQ mode, the pwr_mtr_integ count is number IQ samples - 1. 

    I will send a GC5016 SEK example in the next post.

    Regards,

    Radio Joe

  • Hello Joe,

    problem was solved. Power meter worked since first downloading, but signal was very poor... Low 8 bits on output was working, other had no function... I saw block diagram again and solve this proble.

    Thank you for your time...

    Ondrej